This topic has 11 replies, 4 voices, and was last updated 8 years by Andrei.

  • Author
  • #86191
     thannah
    Participant

    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 CODE
    
    class 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!

    #86327
     Laura
    Moderator

    Hello, 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 solution

    Laura 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 🙂

    #86431
     thannah
    Participant

    You did that already the first time I ask. Is there anyone who could help me array the code?

    #87419
     thannah
    Participant

    any help???

    #87421
     Andrei
    Moderator

    Hi @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.
    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #87424
     thannah
    Participant

    I 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!

    #87425
     Andrei
    Moderator

    In 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 solution
    #95551
     gugga7
    Participant
    This reply has been set as private.
    #95552
     gugga7
    Participant
    This reply has been set as private.
    #95554
     Andrei
    Moderator

    Hello @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 solution
    #95561
     gugga7
    Participant
    This reply has been set as private.
    #95564
     Andrei
    Moderator

    I 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
Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?