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. 25th)
🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

P

  • inLIMITit
  • inLIMITit
  • OFFLINE
  • Posts: 10
  • Thanks: 2
  • Karma: 0
  • Add-ons
2 months 4 weeks ago #339224 by inLIMITit
P was created by inLIMITit
Hello everyone, we run a website with Community Builder and have equipped the community area with separate modules. The community area can be accessed via menu items defined for this purpose. The menu items for the community area have their own CSS class so that the area is different from the rest of the website. So if I call up a profile from the online module or the member list, the defined modules are displayed and the correct CSS class is loaded. With two third-party modules, I now have the problem that the link to the profile looks like this:
Code:
$link = CBApplication::CBFramework()->cbSef('index.php?option=com_comprofiler' . ($user['userid'] ? '&task=userprofile&user=' . (int)$user['userid'] : ''), true, 'html');

This then leads to the modules and the CSS class from the community area not being loaded, but the modules from the homepage. How can I adjust the link so that it works similarly to the official Community Builder modules? I have already looked in the source code there, but found nothing.

Thank you very much for your help!

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
2 months 4 weeks ago #339226 by krileon
Replied by krileon on topic P
Use the below to generate a link to profile that includes Itemid so it is properly attached to a menu item.
Code:
global $_CB_framework; $link = $_CB_framework->userProfileUrl( $user_id );


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.

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

  • inLIMITit
  • inLIMITit
  • OFFLINE
  • Posts: 10
  • Thanks: 2
  • Karma: 0
  • Add-ons
2 months 4 weeks ago #339233 by inLIMITit
Replied by inLIMITit on topic P
Thank you for the quick reply! If I exchange the code with your code, I receive a link that leads to my profile and not to the profile of the corresponding user. I think that's still missing a reference to the user ID?
Code:
 public function getProfileLink($user)  {      $userName = $this->getUserName($user);      if ($user['userid'] && ($user['userid'] == CBApplication::MyUser()->getUserId())) {          $user['userid'] = null;      }      $link = CBApplication::CBFramework()->cbSef('index.php?option=com_comprofiler' . ($user['userid'] ? '&task=userprofile&user=' . (int)$user['userid'] : ''), true, 'html');      $title = Text::sprintf('SWBIRTHDAY_USER_LINK_TITLE', $userName);      return "<a href=\"{$link}\" title=\"{$title}\" rel=\"nofollow\">{$userName}</a>";  }
 

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
2 months 4 weeks ago - 2 months 4 weeks ago #339237 by krileon
Replied by krileon on topic P
You need to insert the users user id into the function I've provided above. So with your code it would be the following.

Code:
global $_CB_framework; $link = $_CB_framework->userProfileUrl( $user['userid'] );


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: 2 months 4 weeks ago by krileon.

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

  • inLIMITit
  • inLIMITit
  • OFFLINE
  • Posts: 10
  • Thanks: 2
  • Karma: 0
  • Add-ons
2 months 3 weeks ago #339241 by inLIMITit
Replied by inLIMITit on topic P
Thank you very much, that worked for me! :)
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum