Forum Replies Created
-
In reply to: Buddypress x-profile visibility doesn't work
Visibility checks are not done when profile data is retrieved ‘outside’ BP_XProfile_Group.
You can use bp_xprofile_get_hidden_fields_for_user() to do your own check.
It is reasonable to expect bp_member_profile_data() to include an argument re visibility check.
So it’s not a bug, but you can create an enhancement request ticket on trac.
I can see why you’d look at bp-core-avatars functions.
But have you tried just replacing the avatar calls in templates with your own function?
You’ll have to hunt down the calls in several templates, but probably easier than messing with core-avatar filters given that you don’t want anything from bp avatar code anyway.
Try it in something like the members loop first:
Of course, in your theme, create an over-ride of the members-loop template first.
In reply to: friends_notification_new_request_messageThis:
add_filter('friends_notification_new_request_message' , 'my_bp_friends_notification_new_request_message' , 110 , 2);Should be:
add_filter('friends_notification_new_request_message' , 'my_bp_friends_notification_new_request_message', 110, 5);5 is the number of arguments you are passing, not 2.
In reply to: [Resolved] Extend bp_members() – Custom QueryInstead of writing new queries to manipulate data after the main user query has run, use this filter to make your adjustments before the main query:
bp_pre_user_query_construct in bp-core-classes.phpAnd run it via a conditional based on the page being viewed.
Then your pagination data will be what you want.In reply to: WP search results page kills BP member widgetsThanks for sharing your fix.
To suggest a change to core code, please use
https://buddypress.trac.wordpress.org/
to submit a ticket re a bug or enhancement.The core devs will definitely see it there.
In reply to: Adding classes to profile fieldsDon’t initialize $i as a string if you’re going to use it as an integer.
if ( $items = bp_get_profile_field_data( array( 'field' => 'Budget' ) ) ) { $i = 0; foreach ( $items as $item ) { ?> <div id="size-<?php echo ++$i; ?>"> <?php echo $item; ?> </div> <?php } }In reply to: activity stream goneI always use the files from
/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypressAnd would put them in:
/wp-content/themes/BuddyEnglish/buddypress/try:
echo bp_core_get_username( bp_get_member_user_id() );In reply to: Search for user role@henrywright-1
I’ve never done it, but don’t see why you couldn’t do that.In reply to: Search for user role?s=band will only search within Post and Page content.
If you want to search by user role, you will need a custom search function.And your 404 means you don’t have a basic search page set up.
https://codex.wordpress.org/Creating_a_Search_PageIn reply to: Buddypress checkbox field display in profileYou could explode to an array and then loop thru it.
But the default is to return an array, so just remove this
$multi_format = 'comma'Then use a foreach loop to generate some markup that uses br or li tags.
In reply to: avoid potential overloadingYes the plugin will use a lot of resources, in the form of spikes.
A lot depends on the amount of resources you have available.
From what you’ve written, it seems that the ‘load’ would come from creating matches based on the questionnaire, not from the actual questionnaire. So storing those answers in another database probably may not help much. And you don’t state whether you’re saving match data.
If you want real-time matching based on interaction with a questionaire, then the only way to find out re performance is to write something and load test it.
You’ll probably find that waiting until a user has completed the questionaire or even a page of it – and then providing matches will be more feasible on a setup with fewer resources.
Good luck.
In reply to: avoid potential overloadingYour question is not simple 🙂
re First: I don’t think a webservice will reduce the load
re Second: each request does Not require reloading WP
Since you’re generating and processing the requests ‘locally’, using a webservice might slow things down, depending on the setup of your servers.
This is different from what you’re doing, but might be helpful:
For member searching, some clients want to include radial results based on zip codes.
So I create a separate database for zip data and do the processing outside WP and then return the results ( zips within the radius) for further processing within WP ( find matching zips).
It’s fast and easy to maintain.In reply to: Combine /user & /user/profile pages?In reply to: Search page to search custom user fieldsYou could use this or study it to write your own:
https://wordpress.org/plugins/bp-profile-search/In reply to: Function to update databse fieldsIn members/index.php, you will see this:
<?php bp_get_template_part( 'members/members-loop' ); ?>Either create your own template and call it there.
Or adjust the members/members-loop.php file.Since you are using a child theme, probably easiest to go with the adjust-file approach.
Based on what you’re doing, there is no need to change members/index.php
In reply to: Hide Admin from Group ListRe your rebuild of the ajax_querystring…
It’s even better to remove yourself before that query is constructed.
Take a look at this hook: bp_pre_user_query_constructRe remove group admin from loop…
That’s a tough one.
I recall not being able to do that or that the consequences were too ugly or some fail.
This is kinda of clunky – but sometimes I create a dummy user for use in those situations.
And make it clear in that profile that you aren’t a member of _____.
It gives you a ‘mask’ to wear and makes it easier to compartmentalize friend requests, etc.In reply to: Database Schema map@xkronik13x
Thanks much for the map.
Do you know when it was generated ?
Or the BP version used ?Please add the patch to the ticket so that core devs can decide if they want it.
@henrywright-1 Solve that one !
In reply to: Add Profile Field to Member Page@bphelp Thanks for the pointer.
@buddhatunes Thanks for the purchase. Looks good on your site.
>This would be something different than their username.
You mean different than their user_id ?
You can create anything you like, such as integer assigned to a user.
How you create it, where you store it and how you use it will require knowledge of WP, BP, php and mysql.In reply to: Xprofile check if user can view field@r-a-y
Any reason not to use bp_xprofile_get_hidden_fields_for_user() ?It’s already an array. No need to turn it into an array. And that not how to create an array anyways.
Try:
<?php global $wpdb; $db_query = "SELECT user_id FROM wp_bp_xprofile_data WHERE field_id = 13 AND value = 'Yes'"; $match_ids = $wpdb->get_col($db_query); ?> <?php if ( bp_has_members( $match_ids ) ) : ?>If that doesn’t work, try:
$members_imploded = 'include=' . implode(",", $match_ids); <?php if ( bp_has_members( $members_imploded ) ) : ?>