1. QuickScriptz
  2. General
  3. Thursday, October 19 2017, 02:56 AM
Hi there,

We're trying to show the usergroup of a particular user below their name in the User Map and User List. Is there any way to do what you described here: https://www.easy-profile.com/support/how-to-show-user-groups-in-report.html

I tried creating an HTML Delimiter field and specified the Availability using Access Levels, but on the User Map & User List all of the HTML Delimiter fields always show up. I also tried using the Content plugin but that similarly did not work.

Any suggestions? If I have to edit the default_user.php template file, what would I use to access the user group? $this->user->usergroup?
admin Accepted Answer
Admin
Hi,
sorry for late reply.

This way is not applicable for all uses case. for example:

- Public
- - Registered
- - UserGroup 1
- - UserGroup 2
With this structure this method will works


- Public
- - - Registered
- - - - UserGroup 1
- - - - - UserGroup 2
With this structure this method will not works because ACL associated to UserGroup1 will be inherit also from Usergroup2

-----------------

Anyway there is another way to make this but this require some PHP and Joomla Devs knowledges.
Our delimiter field type allow you to use Joomla content plugins (docs about this field type at http://docs.easy-profile.com/index.php/article/html-delimiter-field-type).

You can use some free plugin like Sourcerer (https://www.regularlabs.com/extensions/sourcerer) to get usergroups and display with some code like this:

{source}
<?php
global $JSNLIST_DISPLAYED_ID;
if($JSNLIST_DISPLAYED_ID) $owner_id=$JSNLIST_DISPLAYED_ID;
else $owner_id=JRequest::getVar( 'id' , JFactory::getUser()->id );
$usergroups_ids=JUserHelper::getUserGroups( $owner_id );
$db=JFactory::getDbo();
$query=$db->getQuery(true);
$query->select( 'title' );
$query->from( '#__usergroups' );
$query->where( 'id IN ( ' . implode( ',' , $usergroups_ids ) . ' ) ' );
$db->setQuery($query);
$usergrous=$db->loadColumn();
echo implode( ', ' , $usergrous );
?>
{/source}

Put this code in a HTML delimiter field type to show usergroups.

NOTE: this code is not tested and not supported, this is only for example purpose, you need to have PHP and Joomla devs knowledges.
  1. more than a month ago
  2. General
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.