Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

[SOLVED] CB Tabs - Private or Visible only to User

  • kiaridil
  • kiaridil
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
11 years 8 months ago - 11 years 8 months ago #223090 by kiaridil
Hello,

I am trying to figure out how to make some tabs visible only to the User and not to the rest Community.

Is it possible?

Thanks
Last edit: 11 years 8 months ago by kiaridil.

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

  • kiaridil
  • kiaridil
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
11 years 8 months ago #223690 by kiaridil
We need to add the option for the private or public tab, at the back end.
So we edit the .xml file of the plugin that creates the tab.
We can find it at: components/com_comprofiler/plugin/user/<the plugin>
we edit the .xml and add this code just before the: </params>
Code:
<param name="menu_prv" type="radio" default="0" label="Private Tab" description="The tab will be private or public."> <option value="0">Public</option> <option value="1">Private</option> </param>
[Make sure that from the back end you chose the state of the tab(public/private)].
Then from the same location open the main plaugin .php file and find: function getDisplayTab.
Make sure you have the global $_CB_framework;
After the: $params = $this->params; add this code
Code:
if ($params->get('menu_prv') == '1'){ if ($_CB_framework->myId() != $user->id) return null; }

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
11 years 8 months ago #223749 by nant

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

Moderators: beatnantkrileon
Powered by Kunena Forum