Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'buddypress'

Viewing 25 results - 14,376 through 14,400 (of 69,016 total)
  • Author
    Search Results
  • #232906
    Henry Wright
    Moderator

    If you look at my snippet here, you will see that I’ve hooked the my_set_default_member_type() function to bp_core_signup_user. Now, bp_core_signup_user fires each time a new user registers on your website. This means that bp_set_member_type( $user_id, 'student' ) executes each time a new user registers on your site.

    Then if you look here, you’ll see I’ve hooked my youmin_set_role() function to the bp_set_member_type hook (note that the bp_set_member_type hook and the bp_set_member_type() function are different things). This means that when the bp_set_member_type hook fires, the code inside youmin_set_role() will execute.

    So as you can see, you have to use both snippets together, exactly as I’ve written them, in order for things to work.

    #232901
    Henry Wright
    Moderator

    Hi @youmin

    If you don’t already have your roles set-up then this is how you’d add them:

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

    The 3rd parameter is where you’d put your capabilities. In my example above, I’ve created a ‘student’ role which can read and edit posts but can’t delete posts. Feel free to amend these capabilities.

    Ref: https://codex.wordpress.org/Function_Reference/add_role

    Then to pick up on Boone’s suggestion in the Trac ticket, you could do this:

    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 );

    When you use the bp_set_member_type() function like I have done here, this code will assign a role to the user who is signing up. The role that is assigned will be the type you use in bp_set_member_type().

    Hope this helps you.

    #232900
    youmin
    Participant

    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

    #232899
    youmin
    Participant

    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.

    #232897
    mcpeanut
    Participant

    Hey @youmin and @spiritix i hear you both on this matter, after much testing myself on how to do this i have realized the best way to do this is via a few other plugins.

    firstly i would recommend using a membership plugin and a plugin to create your own registration forms as well as a roles capability management plugin, you can then overide the buddypress registration process (but you will lose the ability of integrating the custom fields you create for the buddypress registration unless you tie them into your own registration forms)
    but the way i got around this myself without the problem of having to tie them with my registration forms was to add a buddypress profile progression plugin so once they have registered they will see a notice in the header showing the percentage of the profile they have completed encouraging them to fill the fields in “you could even integrate it with an awards system the more they fill in” its up to you. (to me this works perfectly fine as i can still add as many buddypress fields as an when i want and have a simple registration process to boot).

    if you mess around with this idea you will see that assigning a user to a specific role does infact work with the right combo of plugins and effort, i know this seems a long haul work around but the way i have set it up works fine for me. i may go into more detail for you guys when i have more time and explain exactly how mine works. plus this way if you do decide to implement some kind of pay per view membership for higher levels in the future your ready to go!

    shanebp
    Moderator

    Please do not double post. Duplicate here.

    youmin
    Participant

    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.

    #232889
    youmin
    Participant

    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.

    #232885
    spiritix
    Participant

    btw – how can I have so nice BuddyPress members section?

    Members

    It’s awesome!

    #232883
    shanebp
    Moderator

    Refer to the usage in this file:
    \buddypress\bp-templates\bp-legacy\buddypress\members\index.php

    Or review function bp_directory_members_search_form() in this file and maybe write your own:
    \buddypress\bp-members\bp-members-template.php

    #232881
    mahdiar
    Participant

    Thanks but I mean I use this code for CF7 plugin successfully . I’d like to use it for buddypress . Is it related to wordpress ?

    #232880
    Stagger Lee
    Participant
    add_action( 'bp_before_member_header_meta', 'devb_show_role_on_profile');
    function devb_show_role_on_profile(){
     global $wp_roles;
     
    $user_id = bp_displayed_user_id();
     
    $user = get_userdata( $user_id );
     
    $roles = $user->roles;
     
     if( !$roles)
     return ;
     
     if ( !isset( $wp_roles ) )
     $wp_roles = new WP_Roles();
     
     $named_roles = array();
     
    foreach( $roles as $role ){
     
    $named_roles [] = $wp_roles->role_names[$role];
     }
     
    if( $named_roles )
     echo '<span class="user-role activity">'. join( ', ', $named_roles ) . '</span>';
     
    }

    Showing User role on BuddyPress Profile

    #232878
    danbp
    Participant

    That’s not a BuddyPress related question. BP provides already a few checks over xprofile fields, but not strict security checking.
    As you use contact form 7 plugin to build your fields, you have to check this plugin documentation to achieve this.

    #232877
    danbp
    Participant

    BP works on almost any WP theme, under one condition. the theme should respect the WP rules for themes.

    From this codex page you’ll able to find all documentation around BP themes.

    #232853
    Yann Spect-Acteur
    Participant

    I’ve just install wordpress, then buddypress.
    So same issue.

    spect-acteur.eu
    id : test
    pass : test

    #232842
    kashmiri
    Participant

    Bug report filed here:

    https://buddypress.trac.wordpress.org/ticket/6160

    This has also been pointed out a few years back but issue seems stalled:

    https://buddypress.trac.wordpress.org/ticket/4689

    #232841
    shanebp
    Moderator

    This works properly on my test install, put in bp-custom.php

    function laddi_show_user_role () {
    	$abc_role = bbp_get_user_display_role( bp_displayed_user_id() );
    	echo '<br/><span class="profile-role ' . $abc_role . '"><i class="fa fa-star"></i><em>';
    	echo $abc_role;
    	echo '</em></span>';
    }
    add_action( 'bp_before_member_header_meta', 'laddi_show_user_role' );
    #232831
    patlol
    Participant

    Hello danbp,

    Which plugin do you use for your custom search form ?

    Is your plugin! Isn’t a custom form is the horizontal form proposed in sweetdate->buddypress menu (see first attached file in first message)

    I try disabled all plugin except sweetdate and budypress (if not the “members” and horizontal form no longer exists):
    the first fiels of horizontal form “name” is ok
    the 2 next fields are not ok

    So there are two problems:
    1/ the “name” field does not work due to WordPress SEO plugin, I deleted it. why? I don’t know!
    2/ The others fields are extended fields, fields created by me, “Départements” and “Domaine d’activité” does not even work by removing all plugins except sweetdate and buddypress (if not the “memebers” and horizontal form no longer exists)

    It is for the second case I would need your help

    Thanks

    Where i create the 2 extended fields

    #232829
    youmin
    Participant

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

    #232827
    youmin
    Participant

    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&#8221;

    Thank you once again.

    #232824
    youmin
    Participant

    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.

    #232818

    In reply to: Pagination no-ajax bug

    ripulkr
    Participant

    For now, I have implemented this fix :

    add_filter('bp_get_messages_pagination','correct_buddypress_pagination');
    add_filter('bp_get_members_pagination_links','correct_buddypress_pagination');
    add_filter('bp_course_get_item_pagination','correct_buddypress_pagination');
    function correct_buddypress_pagination($pagination){
    	global $items_template;
    	if($_GET['items_page'] || $_GET['mlpage'] || $_GET['mpage']){
    		preg_match_all('/.+(mlpage|items_page|mpage).([1-9]+).+([1-9]+).+/',$pagination, $matches);
    		if(isset($matches[2]) && isset($matches[3])){
    			if(is_array($matches[2]) && count($matches[2])){
    				foreach($matches[2] as $k=>$match){
    
    					if($match != $matches[3][$k]){
    						$search =$matches[1][$k]."=".$match."'>".$matches[3][$k];
    						$replace=$matches[1][$k]."=".$matches[3][$k]."'>".$matches[3][$k];
    						$pagination = str_replace($search,$replace,$pagination);
    					}
    				}
    			}
    		}
    	}
    	return $pagination;
    }

    I guess it should not have any impact when BuddyPress 2.2 update is released.

    #232817
    mvaneijgen
    Participant

    @Ahir Hermant that is not really my question.

    There are users on the forum, so when I click on there name (lets say user ‘Youmin) I want the site to link to the users page (and that would be this URL /members/Youmin) this works without BuddyPress, but when I have BuddyPress installed all users name get the link /members (and this is just a page with a list of all users.

    So there is no way to get to a users page.

    #232816
    Ahir Hemant
    Participant

    @youmin,

    i have used bbpress and buddypress, there is one widget like Forum Statistics, it will display like total member count, total topic, total forum like that, there is no link i mean total forum 120 then when i click on 120 it will redirect to forum list page. have you got my question now ?

    Thank you

    r-a-y
    Keymaster

    I’ve taken a look at the ticket and have proposed a fix that may not make it to BuddyPress 2.2, but you can patch temporarily:
    https://buddypress.trac.wordpress.org/attachment/ticket/6153/6153.01.patch

    Thank the Atahualpa dev for posting a detailed bug report!

Viewing 25 results - 14,376 through 14,400 (of 69,016 total)
Skip to toolbar