BuddyDev

Search

querying xprofile fields and then showing the total?

  • Participant
    Level: Initiated
    Posts: 11
    Derek Knox on #40662

    Hi guys, is there a plugin in your products that will allow me to add up a certain xprofile field across all our profiles and then show that total?

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #40672

    Hello Derek,

    Thank you for posting. As per my understanding, You are looking for a plugin that allowing you to add any individual Xprofile field across all profiles and Then show that particular field data of all users as a directory list. Please let me know if I understand correctly.

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 11
    Derek Knox on #40673

    Even easier, imagine we had a field called “number of cats you own” and every profile had that filled in that field and was a certain user type

    I would like a plugin that totalled that number up across a user type. Is that possible?

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #40681

    Hi Derek,
    Thank you for the reply.

    will it work if we assist you to achieve this without user type? I am not seeing any efficient way to do with user type.

    Otherwise, It will be a straight forward job with custom code.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 11
    Derek Knox on #40691

    That would be fine! I will just make it so that field can only be filled by that user type using the Buddybev tabs plugin. Thank you! let me know the cost

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #40693

    Hi Derek,
    Thank you.

    Please put the code from this page in your bp-custom.php or your theme’s function.php

    https://gist.github.com/sbrajesh/7d9934d903a2028c1dfd4de258089e51

    and then use the example as shown below:-

    
     * Example 1:- Total Cows owned by our members [xprofile-field-sum field="Number of Cows you Own"]
     * Example 2:- Total Cows owned by our members [xprofile-field-sum field=32]
    

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved