Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter benrellick

    (@benrellick)

    Thanks r-a-y, looking in bp-follow-widgets.php did help. In case anybody else has the same question, here’s what ended up working for me:

    <?php if ( bp_has_members( 'include=' . bp_get_following_ids( array( 'user_id' => bp_loggedin_user_id() ) ) ) ) : ?>

    I noticed that users I had manually added were still not showing up in the loop since their last activity displayed as “Never Active,” so I got around that with this snippet, which I’m not 100% sure of, but I think it did the trick. It looks for users with the role of author that have never been active and sets last_activity to the current time, but theoretically should only have to do this once.

    global $wpdb;
    		foreach ( $wpdb->get_col( "SELECT ID FROM $wpdb->users" ) as $user_id ) {
    			$last_activity = bp_get_user_last_activity( $user_id );
    			if ( user_can( $user_id, "author" ) && $last_activity == '' ) {
    				bp_update_user_last_activity( $user_id, bp_core_current_time() );
    			};
    		};

    Uses bp_update_user_last_activity which only works in Buddypress 2.0

Viewing 1 replies (of 1 total)