BuddyDev

Search

[Resolved] Connecting Xprofilefields to User insights

  • Participant
    Level: Enlightened
    Posts: 51
    Ethan Figliola on #46626

    Hi there we are using xprofile fields to calculate the age from the birth date. however on the backend we are using userinsights to view data and it only shows the birth date in date form not age. Can you tell me the variable used for age so i can replace it in user insights in the display methoad?

  • Participant
    Level: Enlightened
    Posts: 51
    Ethan Figliola on #46627

    User insights plugin buddypress file to show how data is displayed: https://i.postimg.cc/DwXQVHJQ/xprofile-fields.png

    User insights dashboard showing date instead of age: https://i.postimg.cc/s2JhsrVW/userinsights.png

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #46628

    Hi Ethan,
    Thank you for the question.

    From your screenshots, It seems the user insights has the field types hard coded. Birthday is a sub type of date and they should either add the logic for calculating age or use xprofile_get_field_data to have it automatically formatted for them.

    regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 51
    Ethan Figliola on #46634

    Hi Brajesh,

    Could you maybe elborate more on how ot use xprofile_get_field to have it automatically formatted assuming that is the easiest solution.

    User Insights will not help at all.

    I appreciate your kindness in helping I can even provide a suitable payment for the solution.

    Thanks,
    Ethan

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #46635

    Hi Ethan,
    From your screenshot, It seems they are fetching the profile data using their own database methods and treating the field type as text for any field not matching their predefined list.

    BuddyPress has an APi function for fetching a field’s data(xprofile_get_field_data). When this function is used, It fires some of the filetsr which are used by field type to format data.

    I hope that helps.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 51
    Ethan Figliola on #46636

    It definitely shows me more insight to how these functions are working.

    It still sounds a little bit out of my wheelhouse could this be something you could bill me as custom development? Or point me in the direction of a trustworthy person interested in the work?

    Thanks,
    Ethan

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #46637

    Hi Ethan,
    Thank you.

    If you can provide us a copy of userinshights, we can certainly look into it and provide a patch. I believe that the right solution will be to have a patch in the userinsights plugin to avoid it being lost in future versions.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 51
    Ethan Figliola on #46638
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #46640
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 51
    Ethan Figliola on #46641

    Thank you very much.

You must be logged in to reply to this topic.

This topic is: resolved