Skip to:
Content
Pages
Categories
Search
Top
Bottom

Rebooting Activity Stream?


  • mbfit
    Participant

    @mbfit

    Hello, would like to know if there is a way to ‘reboot’ the Site Wide Activity page? As the admin there is a lot of work done by myself as well as other testers/members that all shows in the Activity stream, which is unnecessary and a bit revealing to new members when they join. When I delete the actions from the Activity stream itself, in hopes of removing that info on there, most cases it deletes the work entirely from the site.

    Is there a way to reset it from a new starting point by date etc..? Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)

  • Renato Alves
    Moderator

    @espellcaste

    You can use wp-cli-buddypress to delete the activities from the command line: https://github.com/buddypress/wp-cli-buddypress


    autox420
    Participant

    @autox420

    Not what you are serching for but plugin BuddyPress bulk delete can delete all activity.


    mbfit
    Participant

    @mbfit

    Thank you. I feel the plugin will be less confusing for me


    mbfit
    Participant

    @mbfit

    That plugin was bad advice. It deleted thousands of profiles.


    mbfit
    Participant

    @mbfit

    actually it made them unsearchable so I’m not sure what the issue is


    Boone Gorges
    Keymaster

    @boonebgorges

    @mbfit If by “unsearchable” you mean that they don’t show up in the directory anymore, then the problem is probably that the plugin deleted the ‘last_activity’ activity items for each user. As such, BP doesn’t show them as active users.

    If you retained a backup before you ran the delete process, then you should restore the last_activity items from it. If not, you can run a script that will set last_activity for all users that don’t have it set – though note carefully that it won’t really be *accurate*.

    
    function bbg_set_last_activity() {
        global $wpdb;
        $user_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->users}" );
        foreach ( $user_ids as $user_id ) {
            if ( bp_get_user_last_activity( $user_id ) ) {
                continue;
            }
    
            bp_update_user_last_activity( $user_id );
        }
    }
    

    As to your original question, there is no single UI or command you can run to delete activity items based on date. wp-cli-buddypress would be part of a good solution, but it would take additional scripting to delete based on date range. If you have some familiarity with bash scripting or PHP scripting, I will point you in the right direction, but I don’t want to just give you stuff to copy and paste, because deleting stuff is dangerous 😀


    mbfit
    Participant

    @mbfit

    @mbfit If by “unsearchable” you mean that they don’t show up in the directory anymore, then the problem is probably that the plugin deleted the ‘last_activity’ activity items for each user. As such, BP doesn’t show them as active users.

    Yes you nailed it.

    Tech support copied the file members-loop.php from the main theme to the child theme, so it looks like this childtheme/buddypress/members/members-loop.php

    and code:
    <?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ) . ‘&per_page=’.sq_option( ‘buddypress_perpage’ ) ) ) : ?>

    to:

    <?php if ( bp_has_members( bp_ajax_querystring( ‘members’ ) . ‘&type=alphabetical’ . ‘&per_page=’.sq_option( ‘buddypress_perpage’ ) ) ) : ?>

    In case anyone else every happens to run into this..!


    mbfit
    Participant

    @mbfit

    Thank you Boone Georges!


    Boone Gorges
    Keymaster

    @boonebgorges

    Yes, the alphabetical sort doesn’t require last_activity, which is why it probably caused it to work. In any case, I’m glad you’ve got it sorted out!

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Skip to toolbar