Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • kypto
    Participant

    @kypto

    oh, i feel stupid now 🙂 the solution is:

    add_filter( 'wpcf7_special_mail_tags', 'wpcf7_special_mail_tag_userdata', 10, 2 );
    
    function wpcf7_special_mail_tag_userdata( $output, $name ) {
    
    $name = preg_replace( '/^wpcf7\./', '_', $name );
    
    global $bp;
    
    if ( 'user_login' == $name )
    return apply_filters( 'bp_displayed_user_fullname', isset( $bp->displayed_user->fullname ) ? $bp->displayed_user->fullname : '' );
    }

    kypto
    Participant

    @kypto

    yeah sure, currently its “contact form 7”

    there i could manage the form right from the admin. there is field for the incoming messages, “message body”

    could i use the function from buddypress here? like bp_get_member_profile_data(), or bp_member_name() ? i was just not positive that it will work, and didnt try it yet. now im just building up the structure of the web, so i just wanted to ask if it is possible.

    if it is really that easy, than sorry for the silly question 🙂


    kypto
    Participant

    @kypto

    ok, i got it 🙂 i got the right answer sooner, but while i was testing it i chose wrong group so i thought it was wrong. so the right code will be something like this:

    $authors = BP_Groups_Member::get_group_member_ids (ID_OF_GROUP_YOU_WANT);
    ////////// get the ids of members of the group you chose /////////
    
    unset ($authors[0]);
    $authorsid = implode(',', $authors);
    ////////// get rid of the first element in the array "authors" and then make string "authorsid" from that array. /////////
    
    $the_query = new WP_Query( 'author='.$authorsid);
    ////////// make the query based on authors with the id string parameter /////////
    
    ///////// then you make simple post loop, for example: /////////
    if ( $the_query->have_posts() ) {
    echo '<ul class="news-posts">';
    while ( $the_query->have_posts() ) {
    $the_query->the_post();
    echo '<li>' . get_the_title() . '</li>';
    }
    echo '</ul>';
    } else {}
    /* Restore original Post Data */
    wp_reset_postdata();

    kypto
    Participant

    @kypto

    ok, ignore my last post. i just figured out that you can obtain the members ids with:

    $authors = BP_Groups_Member::get_group_member_ids (ID_OF_GROUP_YOU_WANT);

    then i was trying to turn that array into string and put it into query by authors, but it seems not to work since its supposed to be used with int value.

    i was trying something like this:

    $authorsgroup = implode(',', $authors);
    $posts = "'" . "author=" . $authorsgroup . "'";
    
    $the_query = new WP_Query( $posts );

    …no luck…

    $authorsgroup = implode(',', $authors);
    
    $the_query = new WP_Query( 'author='$authorsgroup'' );

    … no luck …

    etc….

    have you got some idea how to put that ids into the query?


    kypto
    Participant

    @kypto

    * php not java (it was late and i was sleepy :D)


    kypto
    Participant

    @kypto

    thx, but could you help me with that loop? i understand that query thinq, however im not very good at java and cant figure out how to make the loop for members ids work. the goal should be to get the string like “id,id,id” (in order to use it at the query – author=string),but i dont know how to get it from that goups_get_group_member function.

    and one more thing, in documentation there is that the group_id is taken from currect groud (if i get it right :D), but i need it to be from any group i choose.


    kypto
    Participant

    @kypto

    ok thx, nevermind


    kypto
    Participant

    @kypto

    dont mean activity wall but just blog posts

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