solved Linked Profile

mountaintop
@mountaintop
3 years ago
76 posts
need some help

one of the great features of Jamroom is a profile can be linked to another user

my issue is, a e.g. producer is managing several artist profiles.

The producer wants to show on his profile index page the artists managed by him.

This works fine as long the producer has created the artist profile

the search function below does achieve this.
{jrCore_list module="jrProfile" search1="_user_id = {$_user_id}" search2="_profile_id != {$_profile_id}" pagebreak="3" page=$_post.p pager="true"}

However, if the artist has its own user profile, but his profile is also linked to the producer user account, the search does not work.

I understand why this search does not work, my question is what is the field which links the producer user account to the artist profile, when the artist has its own profile account?

tried to find the key, I'm lost

any suggestions, I hope I have described the problem for other to understand

Thank you



--
jesan
FRC All Music

updated by @mountaintop: 03/18/22 02:24:17PM
paul
@paul
3 years ago
4,326 posts
The problem here is that there are no fields in either the profile or user datastores that links them directly to an 'owner' user. That functionality is done in another table, the 'jr_jrprofile_profile_link' table that is just two columns linking users and profiles by their IDs.
To do what you want, in the template you'd need to call the internal 'jrProfile_get_user_linked_profiles($_user_id)' function that returns an array with linked profile IDs as its keys. These key IDs need to be extracted then 'imploded' into a comma-seperated list that can be used in the jrCore_list search parameter.
So you need template code something like this -

{$linked_profile_ids = implode(',', array_keys(jrProfile_get_user_linked_profiles($_user_id)))}
{jrCore_list module="jrProfile" search="_profile_id IN `$linked_profile_ids`" pagebreak="3" page=$_post.p pager="true"}

Hope this helps


--
Paul Asher - JR Developer and System Import Specialist
mountaintop
@mountaintop
3 years ago
76 posts
Thanks you, I have been looking for this table for days. However, even if I would have found it, the implode was new, I never would have figured this one out.

once again thank you,works like a dream :)


--
jesan
FRC All Music