Commit 34a6433f authored by lucha's avatar lucha

[auto] Plugin: buddypress 2.1.1

parent be829e7c
.akismet-status {
float: left;
}
.akismet-status a {
color: #AAA;
font-style: italic;
}
.akismet-history {
margin: 13px;
}
.akismet-history div {
margin-bottom: 13px;
}
.akismet-history span {
color: #999;
}
#wp-bp-activities-wrap {
padding: 5px 0;
}
#bp-activities {
height: 120px;
}
#bp-replyhead {
font-size: 1em;
line-height: 1.4em;
margin: 0;
}
#bp-replysubmit {
margin: 0;
padding: 0 0 3px;
text-align: center;
}
#bp-replysubmit .error {
color: red;
line-height: 21px;
text-align: center;
vertical-align: center;
}
#bp-replysubmit img.waiting {
float: left;
padding: 4px 10px 0;
vertical-align: top;
}
#bp-activities-form .column-response img {
float: right;
margin-left: 10px;
margin-top: 1px;
}
.activity-errors {
list-style-type: disc;
margin-right: 2em;
}
#bp_activity_action div.inside,
#bp_activity_content div.inside {
line-height: 0;
}
#bp_activity_action h3,
#bp_activity_content h3 {
cursor: auto;
}
#bp_activity_action td.mceIframeContainer,
#bp_activity_content td.mceIframeContainer {
background-color: white;
}
#post-body #bp-activities-action_resize,
#post-body #bp-activities-content_resize {
position: inherit;
margin-top: -2px;
}
#bp_activity_link input {
width: 99%;
}
#bp-activities-primaryid {
margin-bottom: 1em;
}
.column-action {
width: 12%;
}
/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
.akismet-status{float:left}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:left;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:right;margin-left:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-right:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}
\ No newline at end of file
......@@ -77,4 +77,4 @@
}
.column-action {
width: 12%;
}
\ No newline at end of file
}
.akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:white}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}
\ No newline at end of file
/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
.akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}
\ No newline at end of file
/* global bp_activity_admin_vars, postboxes, wpAjax */
(function( $ ) {
/**
......@@ -19,7 +20,7 @@ var activityReply = {
// Close textarea on escape
$(document).on( 'keyup', '#bp-activities:visible', function( e ) {
if ( 27 == e.which ) {
if ( 27 === e.which ) {
activityReply.close();
}
});
......@@ -30,7 +31,7 @@ var activityReply = {
*
* @since BuddyPress (1.6)
*/
open : function( e ) {
open : function() {
// Hide the container row, and move it to the new location
var box = $( '#bp-activities-container' ).hide();
$( this ).parents( 'tr' ).after( box );
......@@ -47,9 +48,9 @@ var activityReply = {
*
* @since BuddyPress (1.6)
*/
close : function( e ) {
close : function() {
// Hide the container row
$('#bp-activities-container').fadeOut( '200', function () {
$('#bp-activities-container').fadeOut( '200', function () {
// Empty and unfocus the text area
$( '#bp-activities' ).val( '' ).blur();
......@@ -67,7 +68,7 @@ var activityReply = {
*
* @since BuddyPress (1.6)
*/
send : function( e ) {
send : function() {
// Hide any existing error message, and show the loading spinner
$( '#bp-replysubmit .error' ).hide();
$( '#bp-replysubmit .waiting' ).show();
......@@ -123,7 +124,7 @@ var activityReply = {
var bg, id, response;
// Handle any errors in the response
if ( typeof( xml ) == 'string' ) {
if ( typeof( xml ) === 'string' ) {
activityReply.error( { 'responseText': xml } );
return false;
}
......@@ -136,7 +137,7 @@ var activityReply = {
response = response.responses[0];
// Close and reset the reply row, and add the new Activity item into the list.
$('#bp-activities-container').fadeOut( '200', function () {
$('#bp-activities-container').fadeOut( '200', function () {
// Empty and unfocus the text area
$( '#bp-activities' ).val( '' ).blur();
......@@ -169,4 +170,4 @@ $(document).ready( function () {
postboxes.add_postbox_toggles( bp_activity_admin_vars.page );
});
})(jQuery);
\ No newline at end of file
})(jQuery);
(function(b){var a={init:function(){b(document).on("click",".row-actions a.reply",a.open);b(document).on("click","#bp-activities-container a.cancel",a.close);b(document).on("click","#bp-activities-container a.save",a.send);b(document).on("keyup","#bp-activities:visible",function(c){if(27==c.which){a.close()}})},open:function(d){var c=b("#bp-activities-container").hide();b(this).parents("tr").after(c);c.fadeIn("300");b("#bp-activities").focus();return false},close:function(c){b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide()});return false},send:function(d){b("#bp-replysubmit .error").hide();b("#bp-replysubmit .waiting").show();var c={};c["_ajax_nonce-bp-activity-admin-reply"]=b('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val();c.action="bp-activity-admin-reply";c.content=b("#bp-activities").val();c.parent_id=b("#bp-activities-container").prev().data("parent_id");c.root_id=b("#bp-activities-container").prev().data("root_id");b.ajax({data:c,type:"POST",url:ajaxurl,error:function(e){a.error(e)},success:function(e){a.show(e)}});return false},error:function(c){var d=c.statusText;b("#bp-replysubmit .waiting").hide();if(c.responseText){d=c.responseText.replace(/<.[^<>]*?>/g,"")}if(d){b("#bp-replysubmit .error").html(d).show()}},show:function(d){var e,f,c;if(typeof(d)=="string"){a.error({responseText:d});return false}c=wpAjax.parseAjaxResponse(d);if(c.errors){a.error({responseText:wpAjax.broken});return false}c=c.responses[0];b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide();b("#bp-activities-container").before(c.data);f=b("#activity-"+c.id);e=f.closest(".widefat").css("backgroundColor");f.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:e},300)})}};b(document).ready(function(){a.init();b("#bp_activity_action h3, #bp_activity_content h3").unbind("click");postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})})(jQuery);
\ No newline at end of file
/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
!function(a){var b={init:function(){a(document).on("click",".row-actions a.reply",b.open),a(document).on("click","#bp-activities-container a.cancel",b.close),a(document).on("click","#bp-activities-container a.save",b.send),a(document).on("keyup","#bp-activities:visible",function(a){27===a.which&&b.close()})},open:function(){var b=a("#bp-activities-container").hide();return a(this).parents("tr").after(b),b.fadeIn("300"),a("#bp-activities").focus(),!1},close:function(){return a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide()}),!1},send:function(){a("#bp-replysubmit .error").hide(),a("#bp-replysubmit .waiting").show();var c={};return c["_ajax_nonce-bp-activity-admin-reply"]=a('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),c.action="bp-activity-admin-reply",c.content=a("#bp-activities").val(),c.parent_id=a("#bp-activities-container").prev().data("parent_id"),c.root_id=a("#bp-activities-container").prev().data("root_id"),a.ajax({data:c,type:"POST",url:ajaxurl,error:function(a){b.error(a)},success:function(a){b.show(a)}}),!1},error:function(b){var c=b.statusText;a("#bp-replysubmit .waiting").hide(),b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&a("#bp-replysubmit .error").html(c).show()},show:function(c){var d,e,f;return"string"==typeof c?(b.error({responseText:c}),!1):(f=wpAjax.parseAjaxResponse(c),f.errors?(b.error({responseText:wpAjax.broken}),!1):(f=f.responses[0],void a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide(),a("#bp-activities-container").before(f.data),e=a("#activity-"+f.id),d=e.closest(".widefat").css("backgroundColor"),e.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:d},300)})))}};a(document).ready(function(){b.init(),a("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
\ No newline at end of file
......@@ -437,7 +437,7 @@ function bp_activity_action_sitewide_feed() {
'id' => 'sitewide',
/* translators: Sitewide activity RSS title - "[Site Name] | Site Wide Activity" */
'title' => sprintf( __( '%s | Site Wide Activity', 'buddypress' ), bp_get_site_name() ),
'title' => sprintf( __( '%s | Site-Wide Activity', 'buddypress' ), bp_get_site_name() ),
'link' => bp_get_activity_directory_permalink(),
'description' => __( 'Activity feed for the entire site.', 'buddypress' ),
......@@ -540,7 +540,7 @@ function bp_activity_action_my_groups_feed() {
'title' => sprintf( __( '%1$s | %2$s | Group Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),
'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() ),
'description' => sprintf( __( "Public group activity feed of which %s is a member of.", 'buddypress' ), bp_get_displayed_user_fullname() ),
'description' => sprintf( __( "Public group activity feed of which %s is a member.", 'buddypress' ), bp_get_displayed_user_fullname() ),
'activity_args' => array(
'object' => buddypress()->groups->id,
'primary_id' => $group_ids,
......@@ -647,3 +647,28 @@ function bp_activity_setup_akismet() {
// Instantiate Akismet for BuddyPress
$bp->activity->akismet = new BP_Akismet();
}
/**
* AJAX endpoint for Suggestions API lookups.
*
* @since BuddyPress (2.1.0)
*/
function bp_ajax_get_suggestions() {
if ( ! bp_is_user_active() || empty( $_GET['term'] ) || empty( $_GET['type'] ) ) {
wp_send_json_error( 'missing_parameter' );
exit;
}
$results = bp_core_get_suggestions( array(
'term' => sanitize_text_field( $_GET['term'] ),
'type' => sanitize_text_field( $_GET['type'] ),
) );
if ( is_wp_error( $results ) ) {
wp_send_json_error( $results->get_error_message() );
exit;
}
wp_send_json_success( $results );
}
add_action( 'wp_ajax_bp_get_suggestions', 'bp_ajax_get_suggestions' );
......@@ -29,8 +29,8 @@ function bp_activity_add_admin_menu() {
// Add our screen
$hook = add_menu_page(
__( 'Activity', 'buddypress' ),
__( 'Activity', 'buddypress' ),
_x( 'Activity', 'Admin Dashbord SWA page title', 'buddypress' ),
_x( 'Activity', 'Admin Dashbord SWA menu', 'buddypress' ),
'bp_moderate',
'bp-activity',
'bp_activity_admin',
......@@ -220,7 +220,7 @@ function bp_activity_admin_load() {
'title' => __( 'Item, Link, Type', 'buddypress' ),
'content' =>
'<p>' . __( '<strong>Primary Item/Secondary Item</strong> - These identify the object that created the activity. For example, the fields could reference a comment left on a specific site. Some types of activity may only use one, or none, of these fields.', 'buddypress' ) . '</p>' .
'<p>' . __( '<strong>Link</strong> - Activity generated by posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item. Some types of activity may not use this field, even if it has been set.', 'buddypress' ) . '</p>' .
'<p>' . __( '<strong>Link</strong> - Used by some types of activity (e.g blog posts and comments, and forum topics and replies) to store a link back to the original content.', 'buddypress' ) . '</p>' .
'<p>' . __( '<strong>Type</strong> - Each distinct kind of activity has its own type. For example, <code>created_group</code> is used when a group is created and <code>joined_group</code> is used when a user joins a group.', 'buddypress' ) . '</p>' .
'<p>' . __( 'For information about when and how BuddyPress uses all of these settings, see the Managing Activity link in the panel to the side.', 'buddypress' ) . '</p>'
) );
......@@ -284,6 +284,12 @@ function bp_activity_admin_load() {
) );
wp_enqueue_style( 'bp_activity_admin_css', $bp->plugin_url . "bp-activity/admin/css/admin.{$min}css", array(), bp_get_version() );
wp_style_add_data( 'bp_activity_admin_css', 'rtl', true );
if ( $min ) {
wp_style_add_data( 'bp_activity_admin_css', 'suffix', $min );
}
// Handle spam/un-spam/delete of activities
if ( !empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', ) ) ) {
......@@ -903,7 +909,7 @@ function bp_activity_admin_index() {
<?php if ( !empty( $_REQUEST['aid'] ) ) : ?>
<?php printf( __( 'Activity related to ID #%s', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?>
<?php else : ?>
<?php _e( 'Activity', 'buddypress' ); ?>
<?php _ex( 'Activity', 'Admin SWA page', 'buddypress' ); ?>
<?php endif; ?>
<?php if ( !empty( $_REQUEST['s'] ) ) : ?>
......@@ -1057,6 +1063,7 @@ class BP_Activity_List_Table extends WP_List_Table {
'display_comments' => 'stream',
'show_hidden' => true,
'spam' => 'spam_only',
'count_total' => 'count_query',
) );
$this->spam_count = $spams['total'];
unset( $spams );
......@@ -1072,6 +1079,7 @@ class BP_Activity_List_Table extends WP_List_Table {
'show_hidden' => true,
//'sort' => $sort,
'spam' => $spam,
'count_total' => 'count_query',
) );
// If we're viewing a specific activity, flatten all activites into a single array.
......@@ -1138,8 +1146,6 @@ class BP_Activity_List_Table extends WP_List_Table {
* @since BuddyPress (1.6.0)
*/
function display() {
extract( $this->_args );
$this->display_tablenav( 'top' ); ?>
<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
......@@ -1238,10 +1244,10 @@ class BP_Activity_List_Table extends WP_List_Table {
function get_columns() {
return array(
'cb' => '<input name type="checkbox" />',
'author' => __( 'Author', 'buddypress' ),
'comment' => __( 'Activity', 'buddypress' ),
'action' => __( 'Action', 'buddypress' ),
'response' => __( 'In Response To', 'buddypress' ),
'author' => _x('Author', 'Admin SWA column header', 'buddypress' ),
'comment' => _x( 'Activity', 'Admin SWA column header', 'buddypress' ),
'action' => _x( 'Action', 'Admin SWA column header', 'buddypress' ),
'response' => _x( 'In Response To', 'Admin SWA column header', 'buddypress' ),
);
}
......@@ -1272,23 +1278,43 @@ class BP_Activity_List_Table extends WP_List_Table {
* @param string $which 'top' or 'bottom'.
*/
function extra_tablenav( $which ) {
if ( 'bottom' == $which )
// Bail on bottom table nav
if ( 'bottom' === $which ) {
return;
}
$selected = !empty( $_REQUEST['activity_type'] ) ? $_REQUEST['activity_type'] : '';
// Is any filter currently selected?
$selected = ( ! empty( $_REQUEST['activity_type'] ) ) ? $_REQUEST['activity_type'] : '';
// Get all types of activities, and sort alphabetically.
$actions = bp_activity_get_types();
natsort( $actions );
?>
// Get the actions
$activity_actions = buddypress()->activity->actions; ?>
<div class="alignleft actions">
<select name="activity_type">
<option value="" <?php selected( !$selected ); ?>><?php _e( 'Show all activity types', 'buddypress' ); ?></option>
<option value="" <?php selected( ! $selected ); ?>><?php _e( 'View all actions', 'buddypress' ); ?></option>
<?php foreach ( $activity_actions as $component => $actions ) : ?>
<optgroup label="<?php echo ucfirst( $component ); ?>">
<?php foreach ( $actions as $action_key => $action_values ) : ?>
<?php
// Skip the incorrectly named pre-1.6 action
if ( 'friends_register_activity_action' !== $action_key ) : ?>
<option value="<?php echo esc_attr( $action_key ); ?>" <?php selected( $action_key, $selected ); ?>><?php echo esc_html( $action_values[ 'value' ] ); ?></option>
<?php endif; ?>
<?php endforeach; ?>
</optgroup>
<?php foreach ( $actions as $k => $v ) : ?>
<option value="<?php echo esc_attr( $k ); ?>" <?php selected( $k, $selected ); ?>><?php echo esc_html( $v ); ?></option>
<?php endforeach; ?>
</select>
<?php submit_button( __( 'Filter', 'buddypress' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) ); ?>
......
......@@ -146,10 +146,10 @@ class BP_Activity_Activity {
}
if ( ! empty( $row ) ) {
$this->id = $row->id;
$this->item_id = $row->item_id;
$this->secondary_item_id = $row->secondary_item_id;
$this->user_id = $row->user_id;
$this->id = (int) $row->id;
$this->item_id = (int) $row->item_id;
$this->secondary_item_id = (int) $row->secondary_item_id;
$this->user_id = (int) $row->user_id;
$this->primary_link = $row->primary_link;
$this->component = $row->component;
$this->type = $row->type;
......@@ -157,8 +157,8 @@ class BP_Activity_Activity {
$this->content = $row->content;
$this->date_recorded = $row->date_recorded;
$this->hide_sitewide = $row->hide_sitewide;
$this->mptt_left = $row->mptt_left;
$this->mptt_right = $row->mptt_right;
$this->mptt_left = (int) $row->mptt_left;
$this->mptt_right = (int) $row->mptt_right;
$this->is_spam = $row->is_spam;
}
......@@ -257,6 +257,9 @@ class BP_Activity_Activity {
* Default: false.
* @type array $meta_query An array of meta_query conditions.
* See WP_Meta_Query::queries for description.
* @type array $date_query An array of date_query conditions.
* See first parameter of WP_Date_Query::__construct()
* for description.
* @type array $filter See BP_Activity_Activity::get_filter_sql().
* @type string $search_terms Limit results by a search term.
* Default: false.
......@@ -267,6 +270,9 @@ class BP_Activity_Activity {
* @type string $spam Spam status. Default: 'ham_only'.
* @type bool $update_meta_cache Whether to pre-fetch metadata for
* queried activity items. Default: true.
* @type string|bool $count_total If true, an additional DB query
* is run to count the total activity items for the query.
* Default: false.
* }
* @return array The array returned has two keys:
* - 'total' is the count of located activities
......@@ -305,12 +311,14 @@ class BP_Activity_Activity {
'exclude' => false, // Array of ids to exclude
'in' => false, // Array of ids to limit query by (IN)
'meta_query' => false, // Filter by activitymeta
'date_query' => false, // Filter by date
'filter' => false, // See self::get_filter_sql()
'search_terms' => false, // Terms to search by
'display_comments' => false, // Whether to include activity comments
'show_hidden' => false, // Show items marked hide_sitewide
'spam' => 'ham_only', // Spam status
'update_meta_cache' => true,
'count_total' => false,
);
$r = wp_parse_args( $args, $defaults );
extract( $r );
......@@ -325,6 +333,9 @@ class BP_Activity_Activity {
// Where conditions
$where_conditions = array();
// Excluded types
$excluded_types = array();
// Spam
if ( 'ham_only' == $spam )
$where_conditions['spam_sql'] = 'a.is_spam = 0';
......@@ -333,8 +344,8 @@ class BP_Activity_Activity {
// Searching
if ( $search_terms ) {
$search_terms = esc_sql( $search_terms );
$where_conditions['search_sql'] = "a.content LIKE '%%" . esc_sql( like_escape( $search_terms ) ) . "%%'";
$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
$where_conditions['search_sql'] = $wpdb->prepare( 'a.content LIKE %s', $search_terms_like );
}
// Filtering
......@@ -372,17 +383,35 @@ class BP_Activity_Activity {
$where_conditions[] = $meta_query_sql['where'];
}
// Process date_query into SQL
$date_query_sql = self::get_date_query_sql( $date_query );
if ( ! empty( $date_query_sql ) ) {
$where_conditions['date'] = $date_query_sql;
}
// Alter the query based on whether we want to show activity item
// comments in the stream like normal comments or threaded below
// the activity.
if ( false === $display_comments || 'threaded' === $display_comments ) {
$where_conditions[] = "a.type != 'activity_comment'";
$excluded_types[] = 'activity_comment';
}
// Exclude 'last_activity' items unless the 'action' filter has
// been explicitly set
if ( empty( $filter['object'] ) ) {
$where_conditions[] = "a.type != 'last_activity'";
$excluded_types[] = 'last_activity';
}
// Exclude 'new_member' items if xprofile component is not active
if ( ! bp_is_active