Forum Replies Created
-
Did you look at this?
>they can see the list of members in either alphabetical order or by date of last visit.
You’re referring to the Members page?
And you want to show a profile field ( country ) for each member?You may be interested in this premium plugin:
http://www.philopress.com/products/buddyprofiledata/>Is it possible for the members to add several pictures, up to 5 for instance?
You need to add a gallery plugin, like https://wordpress.org/plugins/buddypress-media/No problem.
Good luck with the project.
Post a link when it goes public.> I have a million other things to code at the moment
Thanks for taking the time to post your code.
If you’d like to suggest an enhancement, please use trac to submit a ticket.
Why would you hack a function in a core file?
2 filter hooks are provided.
You could use filter hook
apply_filters( 'bp_member_avatar', bp_get_member_avatar( $args ) );
in function bp_member_avatar()
and figure out the id and then pass in the ‘id’ via the $args argument for function bp_get_member_avatar.Or you could use the filter hook
apply_filters( 'bp_get_member_avatar', etc...
to change the css id.There is no need to hack that function.
And it’s a bad practice.In reply to: Human Error in BP Source Code???This is a hook.
do_action( 'bp_member_blog_order_options' );It is not called in BP.
It’s there for your convenience.
You can change the hook tag although some other plugin may be calling it.
If you’re over-riding that template, you could add your own hook.In reply to: Restrict subscribers from showing in member listYou need to look at the s2member documentation to figure out how to gather all the ids for level1 members.
Then you can use the ‘include’ parameter in this approach:
https://codex.buddypress.org/developer/bp_user_query/#code-examplesIn reply to: friends_check_friendships not workingTry
bp_is_friend( $user_id )It will check to see if the logged_in user is a friend of $user_id
Returns – ‘is_friend’, ‘not_friends’, ‘pending’.
In reply to: friends_check_friendships not workingIf you’re not on the members page or a profile page, I don’t think bp_displayed_user_id() will work.
You need to get all the member ids and then loop thru them, something like:
friends_check_friendships(bp_loggedin_user_id(), $ids[$i])You’re doing this on a custom WP page?
Rather than use ‘allow php in html’, you should create a template and assign it to that page.You know that /members/mattnetusa/friends/ lists your friends ?
In reply to: Membership ReportingWhat info would be useful in such a report?
Not just a total number per?In reply to: Filtering member results.So you’re creating an additional Members page ?
If not, you don’t need an override.
If you are, you need to change this hook in that override
do_action( 'bp_before_directory_members' )
And call the new hook in the example below.You need to know the id of the xprofile field that stores gender.
You need to know the value that is stored for Males.Then you can tweak this code and put it in your theme functions.php or bp-custom.php
You’ll have better luck on the bbpress forums.
You should be able to put the function in functions.php
But you still need to put this
$current_time = current_time( 'mysql', 1 );
at the top of the template and _not in functions.phpTo show in the members loop, create a template override in your theme for members-loop.php
At the top of your override, paste this:
$current_time = current_time( 'mysql', 1 ); function online_check( $current_time ) { global $members_template; if ( isset( $members_template->member->last_activity ) ) { $diff = strtotime( $current_time ) - strtotime( $members_template->member->last_activity ); if ( $diff < 300 ) // 5 minutes = 5 * 60 echo " online"; else echo " offline "; } }Call it wherever you like in the members loop like so:
online_check( $current_time );It is possible.
I’m not aware of a plugin for that.
So it will require custom code.
You can hire somebody here:In reply to: Sorting Private Message ThreadsYou can’t override core files.
Undo the changes you made to /bp-messages-classes.php
Copy
bp-templates\bp-legacy\buddypress\members\single\messages\single.php
to your child theme so that the dir structure looks like this:
your-theme\buddypress\members\single\messages\single.phpThen in single.php, change
if ( bp_thread_has_messages() ) :
to<?php $args = array( 'order' => 'DESC' ); if ( bp_thread_has_messages( $args ) ) : ?>It helps to turn on debugging in wp-config.php
define('WP_DEBUG', true);add_filter('bp_has_activities', 'mla_filter_out_membership_activities', 10, 3);
should be
add_filter('bp_has_activities', 'filter_out_membership_activities', 10, 3);$args[per_page] should be $args[‘per_page’]
return array($a, $activites, $args);
should be
return array($a, $activities, $args);minor:
$i = $i + 1;
should be
++$i;In reply to: [Resolved] BP_Group_Extension For Single Group?Cool, a 4 year old thread that is still useful.
minor stuff:
You don’t need the $bp global
I’d put the foreach in the ‘if ( $group_id == 1 )’ conditionalI’m a bit surprised that it runs on ‘init’ rather than bp_loaded or bp_init because init seems very early – but the load order in some situations still surprises me.
In reply to: Some profile_data can not be called other do ?Are you sure that the gender field value has been set for the member being viewed?
If it hasn’t been set, nothing will be returned.
In reply to: [Resolved] BP_Group_Extension For Single Group?Which file are you using to load the extensions?
If it’s a plugin, have you tried a simple include based on whether the group in question is being viewed?
Maybe using something like:
if ( bp_is_groups_component() && 'my-group' == bp_current_item() ) :Unfortunately, there don’t seem to be hooks to avoid recording such activity.
And unfortunately you can’t suppress the display of only some group activity stream items – it’s groups or no groups.
So you have to filter all activity stream items – they all use the same code.
Take a look at the filter hook at the bottom of
function bp_has_activities
in
buddypress\bp-activity\bp-activity-template.phpThis thread should give you some code to start with:
https://buddypress.org/support/topic/is-it-possible-to-hide-or-remove-activity-in-the-main-activity-stream-from-certain-groups-while-keep/In reply to: Filter Members List Based On Profile FieldI’ve added a comment to your gist.
If you’re storing the field as a string that is ‘Male’ or ‘Female’, it should be fine.
Otherwise you’ll have to make a few tweaks.In reply to: Filter Members List Based On Profile FieldPlease use https://gist.github.com/ to show us what you have so far.
In reply to: add a column to BP_Groups_List_TableThanks @r-a-y.
I figured as much, but was hoping I was overlooking something obvious.
In reply to: Filter Members List Based On Profile Fieldexample: