Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • wzshop
    Participant

    @wzshop

    Did you manage to fix this?


    wzshop
    Participant

    @wzshop

    Anyone?


    wzshop
    Participant

    @wzshop

    Hi,
    Thanks..
    Is that really the most neat way to go?

    Greetings


    wzshop
    Participant

    @wzshop

    Ok found that you can just create a child template for /buddypress/members/members-loop.php


    wzshop
    Participant

    @wzshop

    Nevermind, the above two functions work. I had a problem with some other code that is fixed now!


    wzshop
    Participant

    @wzshop

    The above 2 functions work on all profile pictures and only some in-text usernames… Not sure why.. Does anybody have a comprehensive solution for this?
    Thanks


    wzshop
    Participant

    @wzshop

    Ok these 2 functions did it for me:

    // define the bp_core_get_userlink callback 
    function filter_bp_core_get_userlink( $a_href_url_display_name_a, $user_id ) { 
    	$user_info = get_userdata($user_id);
    	$name = $user_info->display_name;
    	$link = esc_url( get_author_posts_url($user_id) );
    	$a_href_url_display_name_a = '<a href ="'.$link.'">'.$name.'</a>';
    	return $a_href_url_display_name_a;
    }
    add_filter( 'bp_core_get_userlink', 'filter_bp_core_get_userlink', 10, 2 ); 
    function imborx_profile_link( $link ) {
    global $activities_template; 
    if( $link != bp_loggedin_user_domain() )
    $link = esc_url( get_author_posts_url( $activities_template->activity->user_id ) );
    return $link; 
    }
    add_filter( 'bp_get_activity_user_link', 'imborx_profile_link', 15, 1 );

    wzshop
    Participant

    @wzshop

    Ok, well i managed to do this by the following code (if anyone ever needs it):

    <?php $bp_title_parts = bp_modify_document_title_parts();
     // let's rebuild the title here
    $title = $bp_title_parts['title'];
    if( strpos( $title, 'E-mail' ) !== false ) {echo '<h2>'.substr($title, 0, strpos($title, '-', strpos($title, '-')+1)).'</h2>';}else {echo '<h2>'.substr($title, 0, strpos($title, "-")).'</h2>';}
    ?>

    This will show the first part of the $title, cutting of the rest after the ‘-‘ in the variable.


    wzshop
    Participant

    @wzshop

    ok thanks.. i guess the only way then is by creating a cpt and write each activity as a cpt entry. That way the id will stay unique… Any ideas are welcome.


    wzshop
    Participant

    @wzshop

    This function helped me thanks:

    function bp_plugin_hook_activity_posted_update( $content, $user_id, $activity_id ) {
        // this is a silly example : just to illustrate !!
        $activity_count = get_user_meta( $user_id, 'silly_activity_counter' );
     
        $activity_count = empty( $activity_count ) ? 1 : intval( $activity_count ) + 1 ;
     
        update_user_meta( $user_id, 'silly_activity_counter', $activity_count );
     
    }
     
    add_action( 'bp_activity_posted_update', 'bp_plugin_hook_activity_posted_update', 10, 3 );

    wzshop
    Participant

    @wzshop

    thanks that kinda helped me out!

Viewing 11 replies - 1 through 11 (of 11 total)
Skip to toolbar