Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'buddypress'

Viewing 25 results - 21,626 through 21,650 (of 94,541 total)
  • Author
    Search Results
  • #232914
    Sterke-Jerke
    Participant

    I’m running the latest WP, BuddyP and BBP,
    Setting up new functionality, and now I am strugling:
    I successed in creating groups, making memebers, and creating forums.
    Also users who are not members of a forum need to ask memebersship.

    What I can not fix is following:
    I want to create child (bbpress) forums under a group forum.
    This works OK, but somehow everyone is then allowed to access it….

    Thanks

    #232909
    spiritix
    Participant

    Hello guys

    What I used is:
    – BuddyPress with combination of either bbP private groups plugin or Members plugin or Restrict Content Pro – bbPress plugin
    – I created extended BuddyPress profile fields in registration
    – I restricted access to the forum with one of above mentioned plugins
    – I used my code mentioned in the beginning

    How it looks like:
    – my code works like a charm! once you choose User1 type in registration, it applies subscriber role, User2 subscriber as well, contributor for User3 – THIS WORKS.
    – what does NOT work is restriction via plugins. Have no clue why. With members plugin od pivate groups, I set Forum1 to be accessable ONLY to User3 type of user, but User1 and User2 can access too! Why?! It has nothing to do with my code, after registration you can clearly check it in WP Users that the role has been assigned.

    If I knew hot to restrict access to the forum based on the WP Role, my code would be sufficient to solve this. Can you help with that part?

    @youmin – are upi saying in BB 2.2 access to forum based on the WP role is fixed?

    #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.

    #232886
    barodscheff
    Participant

    Hi guys!

    You already helped me to remove the xprofile links and to display a filtered view of all members on my homepage (https://buddypress.org/support/topic/display-filtered-overview-of-members/#post-231596).

    So I hope you can help me once again.
    I’ve build a network for athletes. Among many other profile fields every athlete have a profile field called “gender” and “sport”. As already mentioned I’ve filtered this on my landing page for a nice overview. The code for female athletes looks like this:

    <?php
    	$sports = array('Archery', 'Badminton', 'Baseball', 'Basketball', 'Bowling', 'Equestrian', 'Fencing', 'Field Hockey', 'Football', 'Golf', 'Gymnastics', 'Ice Hockey', 'Lacrosse', 'Rifle', 'Rowing', 'Skiing (Cross Country)', 'Skiing (Downhill)', 'Soccer', 'Softball', 'Squash', 'Swimming and Diving', 'Tennis', 'Track and Field', 'Volleyball', 'Water Polo', 'Wrestling');
    	$sportsSize = sizeof($sports);
    	$femaleCounter = 0;
    	for ($i = 0; $i < $sportsSize; $i++) {
    		$femaleSport = $wpdb->get_var( "SELECT COUNT(user_id) FROM ar_bp_xprofile_data WHERE value = 'female' AND user_id IN (SELECT user_id FROM ar_bp_xprofile_data WHERE value = '" . $sports[$i] . "')" );
    		if ($femaleSport != 0) {
    			echo '<p>' . $sports[$i] . ' (' . $femaleSport . ')</p>';
    			$femaleCounter++;
    		}
    	}
    	if ($femaleCounter == 0) {
    		echo '<p>Sorry, there are no female athletes registered yet.</p>';
    	}
    ?>

    In the Frontend it could look like this:

    Female:
    Baseball(4)
    Basketball(2)
    Soccer(8)

    Male:
    Baseball(20)
    Basketball(30)
    Tennis(5)

    Now I would like to generate links on the sports as it’s automatically done with profile fields.

    I think there are two problems:
    1) I have already removed xprofile links in profile/members loop.
    2) The sports are not in the members or profile loop.

    Can you help me?

    #232885
    spiritix
    Participant

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

    Members

    It’s awesome!

    spiritix
    Participant

    Hello everybody

    I’d like to ask you for a help with assigning a WP user role based on a BuddyPress registration.
    REASON: I do this because I want to have an automatic way of allowing users after their registration to see and contribude only to specific forums.

    For subscribers I have Forum1 ready,
    for contributors Forum1 AND Forum2.
    Subscribers cannot see the content of Forum2!

    Everything should be automatically done. User comes to the website, registers (chooses type of account), gets access to specific forum.

    If you could suggest a better solution, OK, if not, plese, try to fix this:

    I have BuddyPress installed. I used extended profile fields to create a list of different users, let’s say User1, User2, User3. After hitting “finish registration” button, based on a selection of User1 or User2 or User3, specific role is assigned. So for example:

    If User1 is chosen, user gets WP role subscriber,
    if User2 is chosen, user gets WP role subscriber,
    if User3 is chosen, user gets WP role contributor.

    Something similar is mentioned below with Cimy User Extra Fields, but it does NOT work with BuddyPress registration. If you add anything with Cimy User Extra Fields, you cannot see it in BuddyPress registration.

    What function/code, to what file I should add so I could have my solution?
    Thank you.

    ———————————————————————-

    
    //
    // Modify registration form to include roles
    //
    add_action('user_register', 'register_role');
    
    function register_role($user_id, $password="", $meta=array()) {
       $userdata = array();
       $userdata['ID'] = $user_id;
       $userdata['role'] = $_POST['cimy_uef_USERTYPE'];
       if ($userdata['role'] == 'A Contributor') {
          $userdata['role'] = 'contributor';
       }
       if ($userdata['role'] == 'An Editor') {
          $userdata['role'] = 'editor';
       }
    
       //only allow if user role is my_role
       if (($userdata['role'] == "contributor") or ($userdata['role'] == "editor")){
          wp_update_user($userdata);
       }
    }
    
    #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

    raflosa
    Participant

    Hi!

    I am trying to create a custom search page with BP Profile Search to search buddypress users. However, I don’t know how to add a search by keywords, so I have thought that maybe I could use the standard buddypress search box (I think it can be a good solution), but I don’t know how to add that search box to a specific page. Can anybody help me with this?

    Thank you!

    #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.

    batufan
    Participant

    Hi Buddies,
    Firstly, My english very bad for me but I must explain my problem.
    I can writing code for wordpress themes but My problem: i don’t use buddypress for the themes.When i create wordpress theme, This theme don’t harmonizing with buddypress.For example when I entered http://websitename.com/groups, I saw error page.I deal with the problem for a week but i don’t find solution.What can i do for the problem.Please help friends…

    mcpeanut
    Participant

    Hi i have found this solution to add a cover photo on a users profile using the answer and plugin linked in this post.

    https://buddypress.org/support/topic/cover-photos-for-profiles/

    it works really well apart from one thing, the user can only see his own cover photo when viewing his own profile where as i would like for other users to see the cover photos when visiting someone elses profiles! any ideas what extra code i would need to add to make them show to other users?

    Tranny
    Participant

    After activating BuddyPress, my admin area turned to a blank screen. Launching FTP client and renaming the buddypress subdirectory solved it immediately, but no matter what I tried (deleting the files, reinstalling, cleaning up the transient records from the database, etc), re-activating BP immediately results in everything behind wp-admin turning to a blank screen.

    Search through support forums here lead to no solution. There are recommendations to increase the available memory, but I’m on a very powerful dedicated server with more than 50% memory available. I had this confirmed after consulting with my webhost.

    What’s a guy to do to make BP work?

    PS – I run a very busy website with 10 Million uniques a month, 20% bounce rate, 12 pages accessed per visit, 480k registered members and a new comment made approximately every 2 to 3 minutes. The server is powerful enough to handle this load of traffic and have a lot of extra power for spikes. I’m sure the problem is not with insufficient server resources. Help?

    #232853
    Yann Spect-Acteur
    Participant

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

    spect-acteur.eu
    id : test
    pass : test

    Techknowledgic
    Participant

    Hey

    I have installed buddypress and if I click settings or anything from the admin area I go to an error page “You do not have sufficient permissions to access this page.”

    so what’s wrong?

    thanks

    #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

Viewing 25 results - 21,626 through 21,650 (of 94,541 total)
Skip to toolbar