Forum Replies Created
-
If you’ve found a bug or improvement, please open a ticket on trac.
You should submit an enhancement ticket on trac.
In reply to: Changing “Friends” to “Connections” ?If all the strings you want to translate are appearing in poedit, then you are fine.
The ‘functions’ are related to gettext, not WP or BP functions.
WP / BP uses those functions.Here’s more reading:
http://code.tutsplus.com/tutorials/translating-your-theme–wp-25014In reply to: Changing “Friends” to “Connections” ?It’s a matter of finding the exact syntax.
This works in the function I provided.case 'Friends <span class="%s">%s</span>': return 'Connections <span class="%s">%s</span>';A gettext filter is a reasonable approach if there are one or two labels that need to be changed.
But there are so many different places where ‘Friend’ or some variation is used that in your case you should definitely use a .mo file.
Read:Often there is confusion re the Sources Keywords section of PoEdit, so after you read the above, take a look at http://www.cssigniter.com/ignite/wordpress-poedit-translation-secrets/
especially the section titled ‘Keywords lists, WordPress functions, whaaaaaa?’.In reply to: Just installed Buddypress 2.1.1. No clueBuddyPress does not provide forums.
It will work together with bbPress to provide forums.Get BP working first.
To set-up BP read: https://codex.buddypress.org/getting-started/
In reply to: Changing “Friends” to “Connections” ?Try this in bp-custom.php
function ideas_change_buddypress_text( $translated, $original_text, $domain ) { if ( 'buddypress' !== $domain ) return $translated; switch ( $original_text ) { case 'Friends <span>%d</span>': return 'Connections <span>%d</span>'; case 'Friends': return 'Connections'; default: return $translated; } } add_filter( 'gettext', 'ideas_change_buddypress_text', 10, 3 );In reply to: Filter list of profiles on Member PageYeah, implode is faster.
But without meta array, the query probably won’t work anyway…
Read:
https://codex.wordpress.org/Class_Reference/WP_User_Query#Custom_Field_ParametersIn reply to: Filter list of profiles on Member PageTry:
$custom_ids = $user->ID . '','';In reply to: Filter list of profiles on Member Page>The only issue remaining now is that the members page is still paginating based on the ~2000 members.
That’s because BP has already collected all the members.
And then you decide which to display.
Instead, you should decide which members to collect and then just run the standard bp_members loop.Take a look at:
You’ll have to adjust it to collect all the user ids for s2member_level2.
They probably have code for that.
And then change:$query_array->query_vars['exclude'] = $this->custom_ids; to $query_array->query_vars['include'] = $this->custom_ids;and change:
return $count - $new_count; to return $new_count;In reply to: [Resolved] Require a login for sitewide activityTry this instead:
function wirelab_check_activity_login() { if ( bp_is_activity_component() && ! is_user_logged_in() ) { wp_redirect( get_option('siteurl') . '/wp-login.php' ); exit; } } add_action('get_header', 'wirelab_check_activity_login');In reply to: BP Custom not working?Try it with this approach:
https://gist.github.com/shanebp/119ffd879acc56c324abIn reply to: [Resolved] Require a login for sitewide activityThanks for your input, lol.
Would you find this more acceptable?function wirelab_check_activity_login() { if( ! is_user_logged_in() && bp_is_activity() ) { wp_redirect( 'url to login page' ); exit; } } add_action('bp', 'wirelab_check_activity_login');In reply to: [Resolved] Require a login for sitewide activityTry this in bp-custom.php
function wirelab_check_activity_login() { if( ! is_user_logged_in() ) { wp_die("To view this page you must first log in."); } } add_action('bp_before_directory_activity', 'wirelab_check_activity_login');In reply to: Marked as spammer, but why?What versions of WP and BP ?
Go to wp-admin -> Users, rollover a user, click spam / not spam.
Trying creating a new user from wp-admin.
Try registering as a new user from the front-end.
What happens?In reply to: Remove all Profile / Member LinksFind the template for each situation and follow the code.
For example, for groups, create an overload of
buddypress\bp-templates\bp-legacy\buddypress\groups\single\members.phpIn that file, remove the href on the avatar.
Replace bp_group_member_link() with a call to a custom function that you write in bp-custom.php.
In that function, add a check for the user’s role.Example, untested, return link only if member is an admin
function ourweb_bp_group_member_link() { echo ourweb_bp_get_group_member_link(); } function ourweb_bp_get_group_member_link() { global $members_template; if( is_super_admin( $members_template->member->user_id ) ) return apply_filters( 'bp_get_group_member_link', '<a href="' . bp_core_get_user_domain( $members_template->member->user_id, $members_template->member->user_nicename, $members_template->member->user_login ) . '">' . $members_template->member->display_name . '</a>' ); else return $members_template->member->display_name; }In reply to: Integrating AJAX Activity Stream with custom markup@r-a-y – Thanks for the patch.
And sorry to everyone else re these hijack posts.In reply to: BBpress post edit causes multiple activity entries.In reply to: validate xprofile field’s value on registrationSo the field should contain the user_login of one of the members?
Untested – try this in bp-custom.php.
Put the correct field name in ‘your-field-name’.function crazy_check_referrer() { global $bp, $wpdb; $referrer_field = $_POST['your-field-name']; $referrer_check = $wpdb->get_var( "SELECT ID from wp_users WHERE user_login = '$referrer_field' "); if( $referrer_check == NULL ) $bp->signup->errors['your-field-name'] = __('That person was not found','buddypress'); } add_action('bp_signup_validate', 'crazy_check_referrer');Try this in bp-custom.php
remove_action( 'messages_message_sent', 'bp_messages_message_sent_add_notification', 10 );add_action is ~L. 191 in buddypress\bp-messages\bp-messages-notifications.php
In reply to: Integrating AJAX Activity Stream with custom markup[off topic – If you’ve a spare moment, lol…]
re: the use of count_totalIt might be a factor in this bbpress ticket re Activity entries:
https://bbpress.trac.wordpress.org/ticket/2690https://buddypress.org/support/topic/bbpress-post-edit-causes-multiple-activity-entries/
In reply to: Conflict (sort of) with Social Login & MentionsI’ve never done this, but…
I believe @mention uses a member’s login name – so it is unique.
I also believe you can change that so their user_nicename is used by putting:
( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE', false );
in bp-custom.phpNote: user_login, user_nicename and display_name are all the same unless changed in wp-admin or a user’s profile. But that change only applies to display_name afaik.
So if you want the functionality of @mentions, I believe you need to expose user_login.
@[name] is set via \buddypress\bp-members\bp-members-functions.php -> bp_core_get_username() which has a filter
apply_filters( 'bp_core_get_username', $username );
You could experiment with that filter and see what breaks :}In reply to: Display Calculated fields on Profile?Create a template overload of this file:
buddypress\bp-templates\bp-legacy\buddypress\members\single\profile\profile-loop.phpLook at bp_the_profile_field_name() and bp_the_profile_field_value() – they display the value.
You’ll need to write a conditional using
bp_get_the_profile_field_name and bp_get_the_profile_field_value() so that you can use the values without displaying them.For example:
if( bp_get_the_profile_field_name() == 'current_weight' ) $current_weight = bp_get_the_profile_field_value(); if( bp_get_the_profile_field_name() == 'starting_weight' ) $starting_weight = bp_get_the_profile_field_value(); $weight_lost = $starting_weight - $current_weight; echo '<br/>weight lost so far: ' . $weight_lost;In reply to: bp_get_profile_field_dataDepending on where you’re trying to display this info, you may need to use
xprofile_get_field_data( $field, $user_id = 0, $multi_format = 'array' )For example:
$user_id = 1; $filemakerID = xprofile_get_field_data( 'Fonds', $user_id, $multi_format = 'comma' ); echo $filemakerID;Thank you for your well-formed question.
Try your changes in this file in your overloads:
buddypress\groups\single\members.php