I've created seperate CB User Groups...kind of...

17 years 5 months ago #24949 by leonhouse
So I've been wanting to make my site able to have seperate user groups... One for bands & one for fans & I was initially going to completely hack Community Builder, but I've hacked it in a completely different way, which I now semi-have seperate user groups. What I did was create another install of Mambo/Joomla & installed Community Builder again. Which gives me two different user bases & two seperate community builder components. I also made both sites have the same template & most of the same links.
It's a very basic hack, but it is a very quick way of creating seperate user groups. A lot of things that work for normal users (ie fans) will not work for band users currently, but I hope to figure out how to slowly mix them together to make it seem like the two users aren't seperate at all.

Anyways, if you want to check it out just go to: www.theskiptracers.com

Any advice or help is very much appreciated!

P.S. My plans are to create two seperate user groups with seperate tabs, but have a lot of things mixed together (as in adding bands as friends & the ability of normal users (ie. fans) to add bands, user the shoutbox, submit blogs, and etc...)

This is a complete hack I know, but if it works well I plan to atleast create a tutorial for other users to be able to do the same thing & maybe eventually create a component & plugin that just automates the process without needing to use a hack.

Leon House ( www.LeonHouse.info ) of The Skip Tracers ( www.TheSkipTracers.com )

Please Log in to join the conversation.

17 years 5 months ago #25265 by Styles
Some HAS to help us figure this out... theres gotta be a million topics on this subject and none with even a glimpse of a solution...or even a place to start.

The groups is easy to determine if you use Jacl+
the problem is only in the tabs feature... these should be available with an option to select the type of users that have those tabs.

Joomla doesnt come with the ability of making custom groups but it does however have 3 predifined ones... Public/registered/special
So we should be able to at least associate the tabs with these.
Customisation and modifications for this to work with Jacl+ would be easier too.

Right now i'm trying to figure out how the profile menu is programed to display differently when you are a member or unregistered or when you are on your own profile.
This might help me use similar code to establish a similar feature to allocate tabs depending on the members "group" or privilidges.

Hey!? I want karma too :(
____________________________________________________________

There's a reason they call me Styles with an S
www.stylesmedia.ca - www.sm-music.com - www.perfect-light.com
Want more? Got more!

Please Log in to join the conversation.

17 years 5 months ago #25271 by mikko
I published a semi ready plugin called "privacy policy". This shows how to prevent tabs fro displaying under certain conditions.

You can find this piece of code from this thread

www.joomlapolis.com/component/option,com_joomlaboard/Itemid,38/func,view/id,21742/catid,23/limit,6/limitstart,6/

If would be quite straight forward to modify this code for your needs.

There is a menu component available which enables you to get the content of the menu in a variety of ways.

extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,163/Itemid,35/

With these and a few lines of code you could do the user groups.

mikko

Please Log in to join the conversation.

17 years 5 months ago #25702 by Styles
Hey Mikko

During similar discussions on the forum you've referenced your "privacy policy" plugin as a possible solution.

I beleive that your right in saying that this is a good start to getting what we need. But we would need more guiding on your part.

For instance,
1- Where in the plugin code do you determine the groups?
and how would we reference the JCLPlus Groups instead of the "UnRegistered" "Registered"?

2- how do we deactivate the privacy policy tab so it only displays in the backend?

3- From what i've seen, Privacy Policy should be installed once all the tabs and plugins have been installed so it can add the proper feilds...Am I right?

Hey!? I want karma too :(
____________________________________________________________

There's a reason they call me Styles with an S
www.stylesmedia.ca - www.sm-music.com - www.perfect-light.com
Want more? Got more!

Please Log in to join the conversation.

17 years 5 months ago #25704 by mikko
Styles wrote:

Hey Mikko

During similar discussions on the forum you've referenced your "privacy policy" plugin as a possible solution.

I beleive that your right in saying that this is a good start to getting what we need. But we would need more guiding on your part.

For instance,
1- Where in the plugin code do you determine the groups?
and how would we reference the JCLPlus Groups instead of the "UnRegistered" "Registered"?


It does not do this currently, but it includes a mechanism for preventing tabs from drawing. This is done in getDisplayTab-method, where the value of field cb_privacypolicy is checked from the database. (I do not have the code here on my laptop, so I cannot check the exact place)


You need to overwrite this part to make it check the usergroup instead, and load tab definitions for this usergroup.

2- how do we deactivate the privacy policy tab so it only displays in the backend?


You do not need this tab at all, so you should edit the xml file which comes in the zip file of the plugin. Remove the line which defines this tab.

3- From what i've seen, Privacy Policy should be installed once all the tabs and plugins have been installed so it can add the proper feilds...Am I right?


Yes, unless you want to define your tabs manually to database. The plugin installer modifies the database table which contains definitions for the tabs. It writes itself as the plugin for every single tab and makes a copy of the original table. When a tab is drawn, instad of drawing it normally or calling the original plugin this plugin is called. Then it checks if the tab should be displayed or not. If not, it will set fileds attribute of the original tab object to false so that CB does not draw the tab. If yes, it checks if a plugin was originally assigned to this tab and calls the plugin, which draws the field and does not modify fiels attribute, so that CB is allowed to draw fields.

Only thing that you need to implement is this checking and modify it suit your user group needs.

I subsribed to this thread, so if you have any questions I will know it if you post here.

mikko

Please Log in to join the conversation.

17 years 5 months ago #25736 by Styles
mikko wrote:

Styles wrote:

It does not do this currently, but it includes a mechanism for preventing tabs from drawing. This is done in getDisplayTab-method, where the value of field cb_privacypolicy is checked from the database. (I do not have the code here on my laptop, so I cannot check the exact place)


You need to overwrite this part to make it check the usergroup instead, and load tab definitions for this usergroup.


Ok... This seems to be the line you are refering to
[code:1] $database->setQuery('select cb_privacypolicy_'.$tab->tabid.' from #__comprofiler where user_id='.$user->id);
[/code:1]
and this one
[code:1] if($policy=='public')
$show=true;
else if($policy=='connections'){
$database->setQuery('select referenceid from #__comprofiler_member where referenceid='.$my->id.
' and memberid='.$user->id.' and accepted=1 and pending =0');
[/code:1]


Befor we go any further, I just want to be clear on something:

Lets say I have
Member1 in GroupA
and
Member2 in GroupB

I want GroupA to have a "TAB1" on their profile
and GroupB to have a "TAB2" om their profile

BUT... When Member1 visits Member2's profile
he WILL see TAB2 there and vice versa...right?

So the privacy plugin will control what group has access to what Tab

Post edited by: Styles, at: 2006/11/28 20:54

Post edited by: Styles, at: 2006/11/28 21:07

Hey!? I want karma too :(
____________________________________________________________

There's a reason they call me Styles with an S
www.stylesmedia.ca - www.sm-music.com - www.perfect-light.com
Want more? Got more!

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.588 seconds

Facebook Twitter LinkedIn