restriction of access for tabs

17 years 11 months ago #13581 by king.lui
restriction of access for tabs was created by king.lui
For example it would be beautiful, if tabs only can be see from connected people. it would be soooooo beautiful :kiss:

I know, my english seems a little .. unusual .. but really, it's not bad, it's only a bavarian version :whistle:

Please Log in to join the conversation.

17 years 6 months ago #21792 by BigStef
Replied by BigStef on topic Re:restriction of access for tabs
I Agree,
I need to hide some tabs for "Registered" user, and to show them to "Editor" user. That solution could be a good one. Does anybody know the way to develop a Plugin for that ? The website i'm working on is a professionnal one, so it could be a little budget for that. Let talk about that ?

Please Log in to join the conversation.

17 years 6 months ago #21794 by king.lui
Replied by king.lui on topic Re:restriction of access for tabs
I haven't a plugin, i hacked the comprofiler.class.php
Look here for the result: www.fidikus.de
There're Free- and Premium-User with differently Opinions. At the moment (starting phase) all User are Premium-User. Free User can't see many Tabs, can't send Private Messages etc..

Post edited by: king.lui, at: 2006/10/01 11:37

I know, my english seems a little .. unusual .. but really, it's not bad, it's only a bavarian version :whistle:

Please Log in to join the conversation.

17 years 6 months ago #21820 by BigStef
Replied by BigStef on topic Re:restriction of access for tabs
Hi King.lui
I have just been on your website, testing this new "comprofiler.class.php. So I have subscibe, and sorry for the information i have choosen, but i can't understand german... :-)
Anyway, to see the difference i think i have to pay the 29€, isn'it ? I trust you if you tell me the diffrence beetwen free and premium user, is it possible to know the the way you hacked this file ?
By the way, i found your website very "clean" and nice, and don't worry for your english, mine is a french version from southpacific :-)

Please Log in to join the conversation.

17 years 6 months ago #21922 by king.lui
Replied by king.lui on topic Re:restriction of access for tabs
That was wrong ... see next Posting.

Post edited by: king.lui, at: 2006/10/03 12:54

I know, my english seems a little .. unusual .. but really, it's not bad, it's only a bavarian version :whistle:

Please Log in to join the conversation.

17 years 6 months ago #21929 by king.lui
Replied by king.lui on topic Re:restriction of access for tabs
In administrator/components/com_comprofiler/comprofiler.class.php you have an function _loadTabsList with a query like "SELECT * FROM #__comprofiler_tabs t WHERE t.enabled=1...".
In this query you must add something.

In my example, thera a two tabs with title "Marktplatz" and "Nachweise". This tabs can only be shown from user with #__users->gid 25 and 31 (I'm using JACLPlus for setting them).

Bevore the querym, add someting like this:

[code:1]if( ($my->gid!=25 && $my->gid!=31) || ($user->gid!=25 && $user->gid!=31) ) {
$temp=" AND t.title<>'Marktplatz' AND t.title<>'Nachweise' ";
}[/code:1]

Then supplement the query:
[code:1]if ($this->tabsToDisplay === null) {
$qry .="SELECT * FROM #__comprofiler_tabs t WHERE t.enabled=1 ".($position==null ? "" : "\n AND t.position='".$position);
$qry .= $temp;
$qry .= " ORDER BY t.position, t.ordering";

$database->setQuery($qry);
$this->tabsToDisplay = $database->loadObjectList();
}[/code:1]

That's all.

The code, i posted bevore this post was for show/hide Fields in tabs.

I know, my english seems a little .. unusual .. but really, it's not bad, it's only a bavarian version :whistle:

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.306 seconds

Facebook Twitter LinkedIn