-
Author
-
November 7, 2015 at 19:52 #86191thannahParticipant
I have tried to use the code below to separate clients from all other professionals in my site but I’m not sure how to array it. My only objective is to get clients to NOT be able to search other clients
And if the profile is ‘client’ profile then no other client profiles or members show up in the member directory.
That’s it!
Here’s the code I used;
COPY CODEclass BP_Custom_User_Ids { private $custom_ids = array(); public function __construct() { $this->custom_ids = $this->get_custom_ids(); add_action( 'bp_pre_user_query_construct', array( $this, 'custom_members_query' ), 1, 1 ); add_filter( 'bp_get_total_member_count', array( $this, 'custom_members_count' ), 1, 1 ); } private function get_custom_ids() { global $wpdb; //figure out if the logged-in user is client or professional $sex = xprofile_get_field_data( 3, bp_loggedin_user_id() ); if ( $sex == 'Client' ) $query = "SELECT user_id FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = 3 AND value = 'Client'"; else $query = "SELECT user_id FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = 3 AND value = 'hairstylist'"; $custom_ids = $wpdb->get_col( $query ); return $custom_ids; } function custom_members_query( $query_array ) { $query_array->query_vars['include'] = $this->custom_ids; } function custom_members_count ( $count ) { $new_count = count( $this->custom_ids ); return $new_count; } } function custom_user_ids( ) { new BP_Custom_User_Ids (); } add_action( 'bp_before_directory_members', 'custom_user_ids' );
How to array this. I have clients, barbers, hair stylist, massage therapist, and makeup artist.
Thanks in advance!
November 9, 2015 at 06:39 #86327LauraModeratorHello, will assign the ticket to a higher support level who can help and advise you in your query.
Thanks! 🙂Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
November 9, 2015 at 18:50 #86431thannahParticipantYou did that already the first time I ask. Is there anyone who could help me array the code?
November 15, 2015 at 22:53 #87421AndreiModeratorHi @thannah, the modifications you’re looking for will require a good amount of development time, and as I already told you last time, custom modifications are not subject or priority of our support team.
Please let me know if I can help you with anything else.
CheersHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 15, 2015 at 23:15 #87424thannahParticipantI don’t mind hiring you all to do this for me As I told you before but no one ever gave me that information. If Laura assigned this to a support ticket (TWICE) shouldn’t someone get in touch with me or reply here with that information?
I only want to do one thing. I will give my money to someone that actually wants it then!
November 15, 2015 at 23:18 #87425AndreiModeratorIn your other topic I have already proposed you if you want me to put you in contact with one of our developers but didn’t got a reply from you, so we’ve had all the intention to help you.
For custom inquires please contact our dev team at cornel@seventhqueen.com
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 29, 2015 at 13:51 #95554AndreiModeratorHello @gugga7, please read my last replies from this topic. This is a custom development and I recommend you to hire a developer to help you with it.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 29, 2015 at 14:10 #95564AndreiModeratorI asure you that you won’t find such feature in any wordpress theme, because such feature doesn’t usually reside in a theme, it’s place is in an additional plugin.
We know that it’s one of the most demanded features and probably it will get addressed in the near future by our development team.
A big major update will come in the next months for the SweetDate theme, and at that time we’ll most probably go over all requested features and we’ll try to find solutions for them.
I’m sorry for any inconvenience.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
You must be logged in to reply to this topic.