Kunena 6.2.6 released

The Kunena team has announce the arrival of Kunena 6.2.6 [K 6.2.6] which is now available for download as a native Joomla extension for J! 4.4.x/5.0.x. This version addresses most of the issues that were discovered in K 6.1 / K 6.2 and issues discovered during the last development stages of K 6.2

This category is for discussing issues with the K 2.0 Blue Eagle template.

As general background, My Joomla site template makes a mess of Kunena .

We do not answer questions about other templates for Kunena here.

If you are having problems then, for your own benefit, it would save us all a lot of time if you would kindly post your configuration report when you ask for help from this forum. If you do not post your configuration report we will not ask you for it but you will probably not get your problem solved, either.

Question Adding Joomla User Groups to Sidebar

More
11 years 3 months ago #1 by GJSchaller
I'd like to add a listing of the user groups a user is a member of, to the side bar under their Avatar, on a post. This way, if a user is a member of a specific "Team" (user group), their posts automatically reflect this, without them needing to manually add it to their profile or signature. (It also stops someone from adding it to their profile when they're not a member...)

My request basically breaks down into two parts:

1) How do I query Joomla for the groups a member belongs to? (All groups, except Registered and Super User, should be displayed.)

2) How do I add that output to the Blue Eagle template, under the Avatar / Profile area?

Maybe this could be a plugin, or such - if there's a better way to do it than modifying the template, I'm open to ideas. ;)

Geoffrey Schaller
Technical Officer
Knight Realms

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

More
11 years 3 months ago #2 by GJSchaller
Quick example, done poorly in MS Paint. :P



Geoffrey Schaller
Technical Officer
Knight Realms
Attachments:

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

More
11 years 3 months ago - 11 years 3 months ago #3 by sozzled
I am very interested in this idea of yours. It's my guess that it would probably take about a day or two to write a custom piece of work to do what you want to do.

Breaking this down into the various parts:

We basically need to find a Joomla class that returns the groups to which a member belongs. So far, my little bit of Joomla/PHP knowledge gets me a fraction of the way (and when we learn more about how to get the first part of the answer, let's share our findings). For example, if you want to find out (and display) some property of a particular user, you would write some code like this
Code:
$currentusername = 'GJSchaller' $user =& JFactory::getUser( $currentusername ); if ($user->id == 0) { echo 'There is no user . $currentusername . 'registered on this site.<br />'; } else { $currentuserID = $user->id; }

So that's getting us part of the way. Armed with the user's ID information, it should be possible to use a call to getUserGroups(), like this:
Code:
$currentuserGroups = =& JFactory::getUserGroups( $currentuserID )

The result of that call is an array. Then you need to work your way through each instance of that array to get the details about the groups that the user belongs to and display the information. That's the part that I haven't figured out how to do yet and, by the way, everything I've written about is untested.

The remain questions (after we've obtained the information) is to figure out where is the best place to put the PHP code so that the output is displayed on the Kunena template that you're using. That's a really good question! There are three possibilities:

(1) Hack the template code directly;
(2) Write a template override; or
(3) Write a plugin.

This is where the fun really starts! Have you got a spare hour or two to help us work together on this? It's at this point that we're starting to tap out my knowledge of how one constructs things within Joomla. I would need to do a lot of digging around and experimentation before I started to make any further suggestions. Fortunately for us both, I would guess that there are probably a dozen or more other people who are interested in the same idea that we are, who know something about PHP and how Joomla is put together, who can give us better tips or (if we're really lucky) a finished solution! B)

I'm cool with that, if you are. :lol:
Last edit: 11 years 3 months ago by sozzled.
The following user(s) said Thank You: GJSchaller

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

More
11 years 3 months ago #4 by GJSchaller
I'm definitely interested in helping, although my code skills are next to none. I do have a test environment I can let you play with, though (a clone of my main site).

The twist to this that's not said, is that I actually don't care about CB / GroupJive groups in this case - purely Joomla groups. So even though CB / GJ is installed on my site, I do *not* want this query to deal with this at all! (That would be relegated over to the CB folks, if I did.)

Geoffrey Schaller
Technical Officer
Knight Realms

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

More
11 years 3 months ago #5 by sozzled
I had a couple more passing thoughts on this. It may be better if this is designed as a plugin so that you could write some [XML] parameters to pass to the PHP that allows you to filter out certain groups that you might not want to display. For instance, there may be "internal groups" that a user belongs to that, by displaying this information to the "wrong people" you're giving away some information to people whom you would rather not like to do.

Let's say, for the sake of argument, that you had a group called "Inner Sanctum" that only the most privileged people are even aware of its existence. You may not want to let the general "rank and file" to be even aware of this group's existence. Therefore, displaying every group that a user belongs to may be compromising your setup and, depending on the circumstances, it may not be such a good idea displaying too much information.

For instance, a user may belong to one of the administrator's groups and, perhaps, you don't want to advertise all the groups that this user belongs to. Therefore you may want to filter out those groups from the sidebar display area.

By building a plugin you can set up a comma-separated list/array of groups that should not be displayed. In doing this, the plugin could then be utilised in a more general way. As I said, just a passing thought.

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

More
11 years 3 months ago #6 by GJSchaller
A Kunena Plugin that is configurable sounds reasonable. That way, you could include, or exclude, groups by ID.

Geoffrey Schaller
Technical Officer
Knight Realms

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

Time to create page: 0.373 seconds