Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 32 total)

  • youmin
    Participant

    @youmin

    I think he is referring to roles based on member_type, not by wp capability (role).
    As he mentioned above, his buddypress website having various roles, so he wants to display different profile field based on created role.

    If role is a (member_type) lyricist = profile field
    If role is a (member_type) singer = profile field


    youmin
    Participant

    @youmin

    Many peoples are waiting for this, but their is no exact piece of code to restrict group creation. And their is no latest posts in the Internet regarding restriction. Buddypress has been evolved as a one of best open source platform with best supporting community even though this problem has not been solved, sad part is from past few years many peoples queried about this you can check in this forum till date no solution.
    I’m requesting the community to provide support to restrict group creation ( either direct or based on role) since old codes/plugins are not working any more.
    Thanks


    youmin
    Participant

    @youmin

    ever heard about html and CSS ? …. Lol


    youmin
    Participant

    @youmin

    Hi ,, I too don’t no the exact code but this will help you correct what went wrong,
    You need to tweak it to work with notices.

    Custom Post Type Support for Activity

    Hope this will help you a bit, and don’t forget to publish your corrected codes .


    youmin
    Participant

    @youmin

    Thanks imath, that’s awesome. But this is only one part of my question and another part is Displaying CPT on group home page instead of activity .
    Example : like most plugins do injecting CPT by making sub nav menu ( may be by registering as a new component or with a slug ) or on both activity and group.


    youmin
    Participant

    @youmin

    Thanks Monkey1980 I’ll try, but I suspect it need more codes since in group you need to add the CPT as a menu in group admin menu. So just wanted to know injecting CPT (bp 2.2 method) in group home page.

    And I think we need to change this part

    if ( ! bp_is_active( 'activity' ) ) {
            return;
        }

    To

    if ( ! bp_is_active( ‘group’ ) ) {
    return;
    }

    As well, ya imath will solve it , hoping soon


    youmin
    Participant

    @youmin

    Isn’t it possible to register CPT and display it on group home page instead of activity or on both? Since posting an CPT article on group page is it self an activity. So isn’t on group home page as well ?

    What do I need to change in above piece of code ?


    youmin
    Participant

    @youmin

    Firstly is have set 3 members type using member_type() function . then I set the roles
    Using Henry’s solution
    I.e

    
     add_role(
        'student',
        __( 'Student' ),
        array(
            'read'         => true,  // true allows this capability
            'edit_posts'   => true,
            'delete_posts' => false, // Use false to explicitly 
        )
    
    ); 

    Then by using this function I tie these roles to wo roles.

    function youmin_set_role( $user_id, $member_type, $append ) {
        $userdata = array( 'ID' => $user_id, 'role' => $member_type );
        wp_update_user( $userdata );
    }
    add_action( 'bp_set_member_type', 'youmin_set_role', 10, 3 );

    But still every user is able to create group since by default wp role ‘subscriber’ is loading and buddypress user role let’s the subscriber to create group.

    So isn’t it possible to pass an array to above role function to restrict group creation ? Or any other code snippet ?

    Take a look at https://buddypress.org/support/topic/how-to-bp_set_member_type/


    youmin
    Participant

    @youmin

    Where is the link ?


    youmin
    Participant

    @youmin

    Awesome work, everything is perfect congratulations.
    But only thing which I didn’t like is active time ‘ago’. Its so lengthy. Eg: 2weeks 4days 30 minutes ago. Can’t it be like 2W 4d 30min ago or some Thing sweet shortly.

    Thank you once again really impressed.


    youmin
    Participant

    @youmin

    Edit page in theme\buddypress\groups\home.php


    youmin
    Participant

    @youmin

    Need test I’d and password, from snaps its look clean . perfect color for social site.


    youmin
    Participant

    @youmin

    Awesome and welcome move by you both,

    Waiting for tutorial of your works.

    Than you,


    youmin
    Participant

    @youmin

    In my above comment i mean to say , I have already set member types using bp_set_member_type function (not roles ) .
    So from above snippet I can set roles to these created member types isn’t it ? Or else still these two functions are independent ?


    youmin
    Participant

    @youmin

    Thank you sir its a great relief now. Now I got it.
    I have already assigned the roles now I’ll modify it by this snippet I.e adding and modifying array.
    Thank you once again


    youmin
    Participant

    @youmin

    Hey guys dev Henry Wright had replied to this topic but its not showing here strange!!
    https://buddypress.org/members/henrywright

    But you can see his solution in his profile link provided above, he rectified error


    youmin
    Participant

    @youmin

    Thank you mcpeanut for you research and work, I am glad to see details of your work since I am struck at this point I am willing to impliment it soon. Plz make a time to explain in details.

    BTW have you seen the ticket I had raised ? I am curious about that ticket just because of the new introduced api member_type and the person who reviewed ticket is respectable Chief Dev of buddypress, as per his comment its take 6 lines of codes, to tie WP roles with member_type code. So it means Two solutions at one shot.

    Thank you again.


    youmin
    Participant

    @youmin

    Try editing buddypress/activity/home.php , after copying these files from buddypress plugin to your theme. If you have already copied files from plugin then search the files from activity folder and edit it from there.


    youmin
    Participant

    @youmin

    See this ticket.

    https://buddypress.trac.wordpress.org/ticket/6154#ticket

    Since buddypress 2.2 released we can tightly integrate user roles based on their profile selected. As well their is a hook . if you know php you can create a snippet so that others can get benefits along with you.
    I think same above codes with a little modifications we can hook it to bp_set_members_type at line 2576.


    youmin
    Participant

    @youmin

    Is it buddypress related question or BBPRESS related one ? Be clear in the question.


    youmin
    Participant

    @youmin

    Will you kindly provide me the snippet based on this ticket, as you directed I had raised this ticket and I am happy that their is a solution.

    https://buddypress.trac.wordpress.org/ticket/6154#ticket”

    Thank you once again.


    youmin
    Participant

    @youmin

    So I think its a bbpress related widget,

    Try this one, when you install buddypress you need to set the permalink, try changing this options in settings of buddypress or in bbpress.


    youmin
    Participant

    @youmin

    I did not got what ur question is clearly. You installed bbpress and buddypress . I will suggest you to be clear on problem.


    youmin
    Participant

    @youmin

    yes it wont do any thing, but devs love to play with codes to a new idea lets see what happens. i have raised a ticket .

    https://buddypress.trac.wordpress.org/ticket/6154#ticket

    thanks shanebp its working perfect


    youmin
    Participant

    @youmin

    thanks for quick reply, and i really appreciate your hard work and dedication (Dev’s).

    
     bp_register_member_type( 'student', array(
            'labels' => array(
                'name'          => 'Student',
                'singular_name' => 'student',
    	    'role'          => 'subscriber'
            ),
        ) );
    }
    add_action( 'bp_init', 'bbg_register_member_types' );
    

    will this third parameter in array assign user role?

    and how to out put selected member type ‘name’ below profile avatar ( as meta ) or as it is .

    thank you

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