I'm building a community site using Joomla with Community Builder.

One of the things I'm working on right now is an "about me" book using a jquery pagination. This "book" sits in a tab on the user's profile.

Everything works fine outside of the fact that I can't seem to figure out how to pull the field values for the person's profile you're viewing. I'm able to pull the field values for the logged in user using either the community builder api's or doing a simple db query by defining the $user variable and doing $user->myId or any variation of. But I can't get the script to actually display the values for the person that owns the profile you're actually looking at. I've tried using things like $user->id and other similar things but nothing works.

The problem here lies in the fact I think that the jquery script is actually separate from the profile page it's self and therefore isn't being associated with that user causing the if else statement in defining the $user or $cbuser variable and therefore showing the logged in user's info instead of the profile owner's info when using the cb api. And of course simply doing a db query according to id doesn't work because the script has no way of knowing what user id you're actually looking at.

If this is the case then I guess my question would be how to state in the script that the content within the script belongs to the user id of the page it's in. Surely there has to be a simple way to define what user id is associated with the content you're viewing in the php part of the code.

Anyone have any ideas?