Forums

Load user data in frontend including user group

Newbee 13 Jul, 2011
Hello there,

I'm new to ChronoForms v4, but from what I've seen it's a great extension! Now I'm trying to build a frontend user compontent tool, where members of a specific group can view and edit user data. From the tutorials I've learnt how to load data from a single table and also how to make it editable. However, I need to do this for the user component. My current problem with this is, that I don't know how to get it to load the user groups for each user (as it is done in the administrator users view). Has anyone done this successfully? Can it be done and how do I set it up🤨

Any help is appreciated! 😀
GreyHead 14 Jul, 2011
Hi Newbee,

I think that you can use this in a Custom Code element
<?php 
echo JHTML::_('list.users', 'input_name', 1, 0, NULL, 'name', 1); 
?>

A little more help here

Bob
Newbee 14 Jul, 2011
Thanks for your help, Bob!
This is a great way to build a user dropdown list, but it is not exactly what I need :wink: I'm sorry, I didn't explain myself properly😶 What I would like to do, is to create a frontend view, displaying user data similar to "/administrator/index.php?option=com_users&view=users" without all the backend features, but with the option to edit (block, unblock) users. I can load the basic jos_users table, but not the associated user groups for each user. Is there a simple way to do this?

Cheers!
GreyHead 17 Jul, 2011
Hi Newbee,

I poked around in the Joomla! sites and found this (from this forum thread). I haven't tested it though.
<?php
$user = JFactory::getUser();
$userGroups = $user->getAuthorisedGroups();
?>

Bob
Newbee 18 Jul, 2011
Fantastic! Very useful stuff. It worked for me. Thanks a lot!
elyash7 14 Sep, 2011
Hi Newbee,

Can your guide me on how to make like you do?
Where to insert that custom code element?
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount

{item:title} {images:#}