Thanks for all the help krileon. I have got a nice little photo gallery user plugin with a like system. The only problem is I'm not sure how to make a user object based on the profile being viewed. At the moment I have an ajax function running a script which updates the display. when this script runs it is making a user object for the logged in user and updating the view with his galleries. How would I go about making a user object for the profile being viewed so it updates properly?
Hope that made sense, again thanks for all the help.
No idea how your plugin is written so I can't really help you with that. If you're using the tab endpoint then you'd just send the users id with the ajax URL or grab the displayed user id using API. The endpoint function is getTabComponent, which is called when a below example URL is used.
At the time of initializing the ajax (if from PHP) you can add the displayed user id to the URL and just grab it in your PHP as needed. Example as follows.
The user object sent to getTabComponent is always the viewing user object, but you can get the displayed users user id with the following API call.
Code:
$userId = $_CB_framework->displayedUser();
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
I managed to get it working by having an click function update an invisible input field which inserts the id I need to grab the displayedUser. This proobably isn't the most ideal way of going about it. However, I really dislike the idea of having a page refresh in this kind of tabbed environment. It just feels like poor design.