Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 31)
🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

Community Builder JQuery

  • AlanJones
  • AlanJones
  • OFFLINE
  • Posts: 510
  • Thanks: 42
  • Karma: 2
9 years 11 months ago - 9 years 11 months ago #256007 by AlanJones
Replied by AlanJones on topic Community Builder JQuery
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.

Own Your Own Community!
Last edit: 9 years 11 months ago by AlanJones.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48630
  • Thanks: 8307
  • Karma: 1446
9 years 11 months ago - 9 years 11 months ago #256143 by krileon
Replied by krileon on topic Community Builder JQuery
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.

index.php?option=com_comprofiler&view=tabclass&tab=TAB_CLASS_NAME&format=raw

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.

index.php?option=com_comprofiler&view=tabclass&tab=TAB_CLASS_NAME&user=USER_ID_HERE&format=raw

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.
Last edit: 9 years 11 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • AlanJones
  • AlanJones
  • OFFLINE
  • Posts: 510
  • Thanks: 42
  • Karma: 2
9 years 11 months ago #256146 by AlanJones
Replied by AlanJones on topic Community Builder JQuery
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.

Own Your Own Community!

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum