Forum Replies Created
-
user_id is an integer, not a string.
Try:
xprofile_set_field_data('user_status', 39, 'spam');Glad it worked.
Unless you’re explicitly using the BP default theme, you should use the templates from here:
buddypress/bp-templates/bp-legacy/buddypress[yeah, it’s not intuitive]
BP and bbPress are meant to act that way. So it’s considered a ‘feature’, not a bug.
If you select “Discourage search engines from indexing this site” in WP – Settings – Readings then bbpress new topics and replies won’t be shown in Buddypress Activity.
just fyi – if selected, it will also prevent blog comments from showing up in the activity stream.
In reply to: Topic answers – emails/notificationsYou should.
And – btw – this is the BuddyPress forum.
Your question is better suited to the bbPress forum.In reply to: Administrator / Keymaster and other role problemsYes, it’s unfortunate that bbPress doesn’t clean up the roles it created when uninstalled.
( note: it shouldn’t remove roles when it’s just deactivated. )But this is the BuddyPress forum.
Please ask your question on the bbPress forum.Cannot duplicate this issue.
With the same setup, the activity stream shows new topics and answers from both group and global forums.Are you sure it isn’t your theme?
To confirm, switch to a WP theme like 2012.In reply to: Changing Display Name with other field from databaseUse this filter hook:
apply_filters( 'bp_displayed_user_fullname', isset( $bp->displayed_user->fullname ) ? $bp->displayed_user->fullname : '' );See
function bp_get_displayed_user_fullname()in this file
bp-members/bp-members-template.phpSo handle potential secondary and tertiary sorting ? – yikes.
This can’t be the first time this issue has arisen.
A deep google should turn up something.Henry – good catch. What’s your solution?
function remove_xprofile_links() { remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 ); } add_action( 'bp_init', 'remove_xprofile_links' );In reply to: S2member and BuddypressYou’ll need to write some custom code.
It is more complicated than a ‘tweak’.
You probably need to hire a developer.
You can post jobs here.Try this:
"ORDER BY substring_index( substring_index(u.display_name, ' ', 2), ' ', -1 )";In reply to: How to remove admin from members listThe function I provided works.
It removes a member with ID = 1 from the members loop.
If you want to use some other function or use 2 or more functions that hook to bp_ajax_querystring, then I can’t help you.In reply to: Can I use UserPro plugin ?Did you read this?
In reply to: How to list extended profile fieldsSo when the link is clicked, gather the user ids that match that xprofile field – per the example I pointed you to.
In reply to: How to list extended profile fieldsTake a look at this codex page for an example of gathering user ids based on an xprofile field.
In reply to: How to list extended profile fieldsThis will require good coding skills. You may need to hire a developer. Or maybe somebody will be willing to create the code for you.
To any devs: BP 2.2 will include ‘BP_XProfile_Query‘ to make these kinds of tasks much easier !!!
You don’t show how you call function format_last_name_first.
But this approach is probably better:// members loop - sort by last name if type== alphabetical function alphabetize_by_last_name( $bp_user_query ) { if ( 'alphabetical' == $bp_user_query->query_vars['type'] ) $bp_user_query->uid_clauses['orderby'] = "ORDER BY substring_index(u.display_name, ' ', -1)"; } add_action ( 'bp_pre_user_query', 'alphabetize_by_last_name' );As shown, it will do what your function is doing. You will have to change the ‘-1’ variable, probably to ‘1’. More info.
In reply to: where can i find buddypress’s shortcode ?Not that I know of. There are some widgets. You might be able to use those widgets as guides to write your own shortcodes.
In reply to: [INFO] Useful s2member/buddypress knowledge>what’s the trick to formatting code in the codex?
Sadly, it is not intuitive.
Take a look at how other code examples in the codex are formatted.In reply to: [INFO] Useful s2member/buddypress knowledgeRe: 2. Importing s2member custom fields to buddypress fields
Instead of, for now, editing the codex page, please note the args parameter for add_action.So the ‘2’ here is the arguments parameter.
add_action('wp_login','s2_profile_field_update',10,2);
So the hook provides 2 arguments – very handy & useful.
But your example doesn’t use them in the function s2_profile_field_update.
You can use the $user arg instead of$current_userand thereby get rid of that global.
Use this to see the data in $user:function hook_arg_display( $user_login, $user ) { var_dump( $user ); } add_action('wp_login','hook_arg_display',10,2);imo: There is no Option 1.
In reply to: [INFO] Useful s2member/buddypress knowledgeRe: Filter Users Displayed in Members Directory by s2member role.
There a couple of ways that this can be accomplished without needing to overload the members loop template and then hack it. One of them is bp_parse_args. Please try using it.The goal of this new codex page is to provide simple functions that adhere to best practices for WP and BP, that users can easily paste into bp-custom.php or theme/functions.php.
Thanks for creating the page – looking forward to your updates.
In reply to: How to remove admin from members listAssuming the user_id for the admin is 1, try this:
function infok_exclude_users($qs=false,$object=false){ //list of users to exclude $excluded_users = '1'; //comma separated ids of users whom you want to exclude if($object!='members')//hide for members only return $qs; $args=wp_parse_args($qs); //check if we are searching for friends list etc?, do not exclude in this case if(!empty($args['user_id'])) return $qs; if(!empty($args['exclude'])) $args['exclude']=$args['exclude'].','.$excluded_users; else $args['exclude']=$excluded_users; $qs=build_query($args); return $qs; } add_action('bp_ajax_querystring','infok_exclude_users',20,2);