Compliance with Buddypress Private Profiles

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Compliance with Buddypress Private Profiles

This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 4 years, 4 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #24718
    VUTURE
    VUTURE
    Participant

    Hi there,

    we use Buddypress with this addon that members are able to make their profile private: https://buddydev.com/plugins/bp-profile-visibility-manager/

    Is it somehow possible to make ajax search compliant with that plugin, so it doesn’t show users that want to stay private. Alternatively there could be a “locked” overlay above the picture or a “locked”-icon somewhere in the area (description, on the right..).
    Just that people know, that they don’t need to click on it, because they wont find anything there.

    Picture of the private page and profile found in search: https://1drv.ms/u/s!Apu2w-jQ_0tCgbwWvio33sO-Ik-o8g

    If it’s not possible to do this now, we would suggest it for future updates 🙂

    Thanks in advance,
    Lyss

    • This topic was modified 4 years, 4 months ago by VUTURE VUTURE.
    #24732
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Lyss,

    It depends on how this information is stored. If the visibility is set as a user meta, then it might be even possible to create hidden user meta filter, that would automatically exclude the items.
    If the plugin has an API (function) to check if a user profile is private, then using that in a small custom code snippet would also work.
    Feel free to ask the plugin developer and let me know, there is definitely a way to do it one way or another.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #24793
    VUTURE
    VUTURE
    Participant

    Hello Ernest,

    we asked Youzer, they wrote the private profile info is stored as user meta ‘yz_enable_private_account’.

    Would be great, if you could make it compatible. Youzer offers support if you need anything else.

    Feel free to test it out on our page, but please be gentle, because we are working on the page nonstop and don’t always have a best backup at hand.

    Thanks,
    Lyss

    #24796
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Lyss,

    That would be completely perfect. I cannot access the ajax search pro menu dashboard however, the account does not have permissions.
    I am not sure what values to suggest for the filter. Can you please check the permissions? I will try to check the meta values and quickly construct the correct filter.
    Thanks!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #24800
    VUTURE
    VUTURE
    Participant
    You cannot access this content.
    #24814
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Lyss,

    Thank you very much. Well, a custom code will be required unfortunately.

    Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    add_filter('asp_results', 'asp_filter_users_by');
    function asp_filter_users_by($results) {
      foreach ($results as $k => &$r) {
        if ( $r->content_type == 'user' ) {
          $v = get_user_meta($r->id, 'yz_enable_private_account', true);
          if ( $v == 'on' ) {
            unset($results[$k]);
          }
        }  
      }
      return $results;
    }

    Please be careful, I obviously was not able to test this code. Thank you!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #24837
    VUTURE
    VUTURE
    Participant

    Hello Ernest,

    thank you for your collaboration!
    Your snippet works perfectly. 🙂

    We provided this to youzer dev-team.

    Best regards
    Chris

    #24843
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.