Skip to:
Content

BuddyPress.org

Changeset 2405


Ignore:
Timestamp:
01/22/2010 01:03:10 PM (15 years ago)
Author:
apeatling
Message:

Hide a user's activity when they are marked as a spammer.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r2397 r2405  
    734734}
    735735
     736function bp_activity_hide_user_activity( $user_id ) {
     737    return BP_Activity_Activity::hide_all_for_user( $user_id );
     738}
     739
    736740/**
    737  * bp_activity_thumnail_content_images()
     741 * bp_activity_thumbnail_content_images()
    738742 *
    739743 * Take content, remove all images and replace them with one thumbnail image.
     
    743747 * @return $content str - The content with images stripped and replaced with a single thumb.
    744748 */
    745 function bp_activity_thumnail_content_images( $content ) {
     749function bp_activity_thumbnail_content_images( $content ) {
    746750    preg_match_all( '/<img[^>]*>/Ui', $content, $matches );
    747751    $content = preg_replace('/<img[^>]*>/Ui', '', $content );
     
    773777    }
    774778
    775     return apply_filters( 'bp_activity_thumnail_content_images', $content, $matches );
     779    return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches );
    776780}
    777781
  • trunk/bp-activity/bp-activity-classes.php

    r2397 r2405  
    540540        return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE content = %s", $content ) );
    541541    }
     542
     543    function hide_all_for_user( $user_id ) {
     544        global $wpdb, $bp;
     545
     546        return $wpdb->get_var( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET hide_sitewide = 1 WHERE user_id = %d", $user_id ) );
     547    }
    542548}
    543549
  • trunk/bp-blogs.php

    r2397 r2405  
    261261
    262262    /* Remove large images and replace them with just one image thumbnail */
    263     if ( function_exists( 'bp_activity_thumnail_content_images' ) && !empty( $content ) )
    264         $content = bp_activity_thumnail_content_images( $content );
     263    if ( function_exists( 'bp_activity_thumbnail_content_images' ) && !empty( $content ) )
     264        $content = bp_activity_thumbnail_content_images( $content );
    265265
    266266    if ( !empty( $action ) )
  • trunk/bp-core.php

    r2389 r2405  
    468468            bp_core_add_message( __( 'User removed as spammer.', 'buddypress' ) );
    469469
    470         do_action( 'bp_core_action_set_spammer_status' );
     470        /* Hide this user's activity */
     471        if ( $is_spam && function_exists( 'bp_activity_hide_user_activity' ) )
     472            bp_activity_hide_user_activity( $bp->displayed_user->id );
     473
     474        do_action( 'bp_core_action_set_spammer_status', $bp->displayed_user->id, $is_spam );
    471475
    472476        bp_core_redirect( wp_get_referer() );
     
    18121816 *
    18131817 * @package BuddyPress Core
    1814  * @param $username The username of the user
    1815  * @uses delete_usermeta() deletes a row from the wp_usermeta table based on meta_key
     1818 * @param $auth_obj The WP authorization object
     1819 * @param $username The username of the user logging in.
     1820 * @uses get_userdatabylogin() Get the userdata object for a user based on their username
     1821 * @uses bp_core_redirect() Safe redirect to a page
     1822 * @return $auth_obj If the user is not a spammer, return the authorization object
    18161823 */
    18171824function bp_core_boot_spammer( $auth_obj, $username ) {
  • trunk/bp-core/bp-core-avatars.php

    r2398 r2405  
    386386        return WP_CONTENT_URL;
    387387
    388     return apply_filters( 'bp_core_avatar_upload_path', get_blog_option( BP_ROOT_BLOG, 'siteurl' ) );
     388    return apply_filters( 'bp_core_avatar_url', get_blog_option( BP_ROOT_BLOG, 'siteurl' ) );
    389389}
    390390
  • trunk/bp-themes/bp-default/members/single/messages/messages-loop.php

    r2397 r2405  
    33<?php if ( bp_has_message_threads() ) : ?>
    44
    5     <div class="pagination" id="user-pag">
     5    <div class="pagination no-ajax" id="user-pag">
    66
    77        <div class="pag-count" id="messages-dir-count">
Note: See TracChangeset for help on using the changeset viewer.