Forum Replies Created
-
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,
SaschaBTW: Do you know where I can find a snippet that auto loads more WP posts?
In reply to: SOLVED: Limit Members Loop by Profile FieldsHi 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 upif (bp_has_members( ‘exclude=’ . exclude_by_role($excluded_roles) . ‘&’ . bp_ajax_querystring( ‘members’ ) ) ) : ?>
`In reply to: Excluding Roles from the member loop!Hi there,
exactly looking for the same stuff!In reply to: Filter members by custom fieldsIs anyone still watching this? Would love to get this functionality working!!
In reply to: Activation Email with Gravity Forms@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…In reply to: Filter members by custom fieldsHi 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?@t.sjogren
does this work?In reply to: SOLVED: Limit Members Loop by Profile FieldsI 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!
In reply to: SOLVED: Limit Members Loop by Profile FieldsHi 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!
In reply to: user role in members slugAny ideas anyone?
Hey there,
I looking for a solution to that too! Any answers yet?In reply to: user role in members slug@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/millerhave 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….
SIn reply to: Different profiles for different user types@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.In reply to: user role in members slug@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).
SaschaIn reply to: Different profiles for different user typesHi 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…
SaschaIn reply to: How remove Reply button in global activityHi there,
is there a hook to achieve the same? Do really want to avoid hardcoding in the theme files…..Hi there,
has there been any progress on this? Just so I do not need to start from scratch…In reply to: Profile page+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.