Forum Replies Created
-
In reply to: Order members by specific ID set
Yes.
To preserve the order, use the ‘user_ids’ parameter.
More info.In reply to: Unregistered action on Activity admin screenIn reply to: [Resolved] Avatars Loading from Wrong URLIt’s not just avatars, it’s all images that are coming from what I guess is the old site.
How did you move your site?
Did you update the htaccess file?
Did you do a search & replace on the database to change urls?
In reply to: Trouble with Members LoopIs your sidebar in a BuddyPress page ?
Take a look at the BP_Core_Members_Widget
In reply to: Frontend User SearchIn reply to: [Resolved] Custom Display on Members Directory>As an alternative solution, is it possible to exclude all members in the above list if they had selected ‘N/A’ for Dog Breed?
Yes, there are 2 ways:
1) https://codex.buddypress.org/plugindev/using-bp_parse_args-to-filter-buddypress-template-loops/
2) https://codex.buddypress.org/developer/loops-reference/the-members-loop/#code-examples>Is it possible for me to not display the line for ‘N/A No Dog’ whenever a member has specificed “No Dog” in the ‘Dog Breed’ field on their profile?
Yes, use bp_get_member_profile_data instead:
$dog_size = bp_get_member_profile_data('field=Dog Size'); if ( $dog_size != false ) echo $dog_size;In reply to: Adding New Profile Tab ContentAdd this to bp_core_new_nav_item
'parent_url' => bp_loggedin_user_domain() . '/favourites/', 'parent_slug' => $bp->profile->slug, 'default_subnav_slug' => 'favourites'or this:
'parent_url' => bp_displayed_user_domain() . '/favourites/', 'parent_slug' => $bp->profile->slug, 'default_subnav_slug' => 'favourites'In reply to: Adding New Profile Tab ContentDid you try it with just “members/single/plugins” ?
In reply to: Adding New Profile Tab ContentTry changing this:
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘buddypress/members/single/plugins’ ) );To this:
bp_core_load_template( 'members/single/plugins' );In reply to: [Resolved] Display xProfile field groupsTry fetching just one field. If you pass in an id, don’t make it a string.
$my_field = xprofile_get_field_data(10);
or
$my_field = xprofile_get_field_data(10, $user_id);Because you’re in a sidebar, this may not work, but replace ‘Company’ with a field name and try:
$my_field = bp_get_member_profile_data( 'field=Company' );In reply to: [Resolved] Display xProfile field groupsIt seems you are on a member profile page, so try using bp_displayed_user_id() instead.
In reply to: Translation fails only at "Sitewide Activity">I also added all gettext filters to the po …without any result.
Odd, simply adding _x:1,2c to Sources keywords in poedit works perfectly for myself and other devs.
If you open a ticket, please mention this discrepancy in results.
In reply to: Translation fails only at "Sitewide Activity"Just fyi – if you only have a few labels that you want to change, you can use these functions.
https://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
https://codex.wordpress.org/Plugin_API/Filter_Reference/gettext_with_contextIt’s a lot faster than messing with .po files.
But you need to know if the label is using a context parameter.So you can use this approach for ‘Sitewide Activity’…
function example_gettext_with_context( $translated, $text, $context, $domain ) { if ( 'buddypress' !== $domain ) return $translated; switch ( $text ) { case 'Sitewide Activity': return 'Bongos'; default: return $translated; } return $translated; } add_filter( 'gettext_with_context', 'example_gettext_with_context', 11, 4 );In reply to: Translation fails only at "Sitewide Activity"You need to add this:
_x:1,2cTo Catalog Properties > Sources keywords in PoEdit.
This is due to the use of the ‘context’ parameter for some titles via ‘_x’
For example, the second element is the context parameter:
_x( 'Sitewide Activity', 'component directory title', 'buddypress' )Make sure your Sources Keywords has at least these entries:
_ _() __ __() _x:1,2cI use this approach and can change titles like ‘Sitewide Activity’
In reply to: Remove Friendship Notifications from Activity StreamIn this context, component IDs are the name of the component.
I would use the ‘action’ filter and leave out ‘friendship_created’.
Before you make changes, created a template over-ride for the activity-loop template.
See:
In reply to: Remove Friendship Notifications from Activity StreamTake a look at:
In particular: filtering-options re action and object, and filtering-examples
Take a look at wp-admin/users.php ~L. 249 re wp_dropdown_users().
There are no hooks, so it’s a core file hack situation – eek.
Probably have to replace wp_dropdown_users() with a dummy select.
In reply to: Error at buddypress group pageSounds like a theme issue.
To confirm, switch to a WP theme like TwentyTwelve.In reply to: How do I make line/paragraph breaks in Group posts?Have you tried filtering the output through nl2br() ?
I think that is a WP issue rather than a BP issue.
Have you tried deleting a user from the front-end, on their profile Settings > Delete Account ?
In reply to: How to force photo-visibility settingsBuddyPress does not provide photo albums.
So you are using a plugin or theme that adds that functionality.
You should contact the creators of that plugin or theme.
In reply to: Activating existing users> Do you think you could tell me where exactly I should paste the code?
No. We don’t know what you’re trying to do.
But you definitely don’t want to paste it into a template.
You want to put it in theme functions.php or bp-custom.php
Maybe you want to run it once to handle existing users.
Maybe you want to run it in certain situations, for example on new registers:
function make_user_active( $user_id ) { bp_update_user_last_activity( $user_id ); } add_action ('user_register', 'make_user_active', 1, 11);In reply to: Activating existing usersThere is no need to do a direct insert to the database.
Use the provided function instead:
bp_update_user_last_activity( $user_id );It will create a last_activity entry for that user with the current time on your server.
So the user will then be ‘active’.You can use the function in a loop to batch process users.
In reply to: Noob Question – How to Import Users as Members?hlna’s code uses the old method for storing last_activity.
It was appropriate when written, but is no longer valid.It can easily be updated by following the instructions here re new API functions:
User last_activity data and BuddyPress 2.0