Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 18 replies - 26 through 43 (of 43 total)
  • @landwire

    Participant

    Hi Juan,
    that is such a cool solution! Cannot wait until you had time to update the snippet and then I will try it out on my new install.

    Thanks for this,
    Sascha

    BTW: Do you know where I can find a snippet that auto loads more WP posts?

    @landwire

    Participant

    Hi all,

    I modified the code from DuableLLC a bit to check for roles. I post it in case someone is looking for a solution like that:

    This function goes in the functions.php

    `// to exclude only defined roles in the Buddypress Members LOOP

    function exclude_by_role($exclude_roles) {

    $memberArray = array();

    if (bp_has_members()) :
    while (bp_members()) : bp_the_member();
    $user = new WP_User( bp_get_member_user_id() );
    $user_role = $user->roles[0];
    foreach ($exclude_roles as $exclude_role) {
    if ($exclude_role==$user_role) {
    array_push($memberArray, $user->ID);
    break;
    }
    }
    endwhile;
    endif;

    $theExcludeString=implode(“,”,$memberArray);

    return $theExcludeString;
    }`

    Then in the template members-loop.php you use:
    `$excluded_roles = array (‘administrator’, ‘author’, ‘subscriber’); // this can be any roles you have set up

    if (bp_has_members( ‘exclude=’ . exclude_by_role($excluded_roles) . ‘&’ . bp_ajax_querystring( ‘members’ ) ) ) : ?>
    `

    @landwire

    Participant

    Hi there,
    exactly looking for the same stuff!

    @landwire

    Participant

    Is anyone still watching this? Would love to get this functionality working!!

    @landwire

    Participant

    @WebEndev,
    did that issue get fixed yet? I also would like to see the activation email working with the user registration add-on. I cannot access GF’s user registration add-on forum…

    @landwire

    Participant

    Hi all,
    looking to exactly do this. Filter members by user role! Can anyone share any code? I think that would be a great addition to the BP core anyway!!!
    @buzz2050 Have you got any code to share?

    @landwire

    Participant

    @t.sjogren
    does this work?

    @landwire

    Participant

    I can still see a problem in making this whole thing dynamic. I.e: have seperate loops for lets say ‘students’, ‘academics’ and ‘staff’. Would that be possible to implement? Basically the values that are passed to inclide_by_meta would have to change according to which name/value/role I want to filter by. That is a bit over my head, as I’m not a coder. Any help is appreciated!

    @landwire

    Participant

    Hi there,
    how does your code behave in BP 1.5? I am trying to filter members by user role and used the following code:
    `

    <?php
    $user_role = array (
    ‘role’ => ‘author’,
    );

    $all_authors = get_users ($user_role);

    $members_to_be_included = array ();
    foreach ($all_authors as $all_author) {
    $members_to_be_included[] = $all_author->ID;
    }
    ?>

    `

    The problem I run into though is that when I use the filter members by ‘active’, ‘alphabetical’ etc. those filters would not work anymore. Do they work with your code? Will definitely try this out!

    @landwire

    Participant

    Any ideas anyone?

    @landwire

    Participant

    Hey there,
    I looking for a solution to that too! Any answers yet?

    @landwire

    Participant

    @Paul
    Not sure what you mean by create profile field dropdown?
    I will let the users choose their role on registration (with a dropdown). Then I would like to have a prettier slug in the browser, rather then:
    members/anthony
    members/higgins
    members/miller

    have the setup from my first post in this thread.

    I would like already in the slug to see that that user is an academic or whatever. It’s not crucial, but it would be a nicer way of browsing (in my eyes at least).

    Also when I use the who’s online widget I would like to use it more than once in the sidebar and each instance showing different user roles. Have you got any hints on how to achieve that? Have not played with the widget yet….
    S

    @landwire

    Participant

    @tiptap
    Hello tiptap,

    did you get your different user types/roles in the members slug ever working (as per your thread about different profiles for different user types)? Just before I start something that cannot be accomplished……
    If you have I would be glad if you give me some hints or even share some code.
    Sascha.

    @landwire

    Participant

    @Paul Gibbs
    Ok,
    if someone would know I’m sure it would be you! I will not even start fiddling around in core files then….
    But, if someone has an idea, I would be glad to hear it.
    Can it be put down as a feature request? I think it makes sense to separate users out (if you want to).
    Sascha

    @landwire

    Participant

    Hi there,
    anyone got an answer to the very first question on this discussion? Would love to change the slug according to user roles! And have different profiles themes…
    Sascha

    @landwire

    Participant

    Hi there,
    is there a hook to achieve the same? Do really want to avoid hardcoding in the theme files…..

    @landwire

    Participant

    Hi there,
    has there been any progress on this? Just so I do not need to start from scratch…

    In reply to: Profile page

    @landwire

    Participant

    +1
    That really would interest me too. Ideally showing the different group names as headings for the sections if there is any data in any of those fields.

Viewing 18 replies - 26 through 43 (of 43 total)
Skip to toolbar