Skip to:
Content
Pages
Categories
Search
Top
Bottom

buddypress usernames only


  • intimez
    Participant

    @intimez

    Some members do not use the correct ‘@ mentions’ so trying to use the plugin linked below. Has anyone had success with a different plugin?

    http://wordpress.org/extend/plugins/buddypress-usernames-only/

    getting error:
    Warning: Missing argument 2 for ray_bp_get_activity_action() in /public_html/wp-content/plugins/buddypress-usernames-only/bp-usernames-only.php on line 111

    Several lines above and below line 111
    `/* ACTIVITY OVERRIDES —————— */

    // used in activity comments
    function ray_bp_acomment_name( $name, $comment ) {
    return $comment->user_login;
    }
    add_filter( ‘bp_acomment_name’ , ‘ray_bp_acomment_name’, 1, 2 );

    // used in parent activity update
    // not the best method… especially if the user has changed their display name multiple times
    function ray_bp_get_activity_action( $action, $activity ) {
    $displayed_user = bp_core_get_core_userdata( $activity->user_id );

    return str_replace( ‘>’ . $displayed_user->display_name . ” . $displayed_user->user_login . ‘<', $action );
    }
    add_filter( 'bp_get_activity_action', 'ray_bp_get_activity_action', 1, 2 );`

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

  • intimez
    Participant

    @intimez

    No one using this plugin?


    intimez
    Participant

    @intimez

    Can someone point me to the plugin used for the @ mention on buddypress.org shown below the person’s avatar?


    Tori
    Participant

    @satoriassecret

    @intimez I’m not using that plugin, but I did have the same issue.
    I hope you’ve fixed yours by now, but if not, here’s what I did:

    In the bp-activity-template.php file, edit this function

    function bp_get_activity_comment_name() {
    		global $activities_template;
    
    		if ( isset( $activities_template->activity->current_comment->user_nicename ) )
    			$name = apply_filters( 'bp_acomment_name', $activities_template->activity->current_comment->user_nicename, $activities_template->activity->current_comment );  // backward compatibility
    		else
    			$name = $activities_template->activity->current_comment->display_name;
    
    		return apply_filters( 'bp_activity_comment_name', $name );
    	}

    The last line is all you need to change. Basically, you’re changing “user_fullname” to “user_nicename”.
    I know it’s not ideal to edit bp files, but this is currently the only way I know how to display usernames in comments. Hope this helps someone!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘buddypress usernames only’ is closed to new replies.
Skip to toolbar