0

I use Joomla 3.4.4

I would like to view list of users in front end. Along with username i need to view profile data, email and phone, in front end. Is there and extension/plugin/component available?

I checked many plugins but no one give phone number. They provide registration date, and other data, but for me email and phone no are important.

Thanks.

3 Answers 3

0

You can write a module or plugin to get this done.

https://docs.joomla.org/J3.x:Creating_a_simple_module/Developing_a_Basic_Module

A shorter way is to download a module which shows your user list and edit the view file (modules/mod_xyz/tmpl/default.php). If not badly written you can just replace unnecessary things.

To know which one you need, just print_r or var_dump your db user object (see zeidanbm answer) like this:

echo '<pre>';
print_r($result);
die;

(Don't do that on a live site.)

You will get a print out of the object and the available fields.

Sorry, can't offer a more detailed answer, I just would write down a complete module...

0
0

One way of doing this is to create a new article and insert a php code which will connect to the database and read from the users table. To do that you will need an extension that lets you use php in articles. I personally use Sourcere but you can use any. Here's a sample of the code that can get you started.

<?php
$db = JFactory::getDbo(); 

$query = $db->getQuery(true)
        ->select($db->quoteName(array('username', 'email')))
        ->from($db->quoteName('#__users'));

$db->setQuery($query);

$result = $db->loadObjectList();

foreach ($result as $row) {
echo $row->username.'|'.$row->email;
}
?>

And for the phone number and other profile things you can do the same but change the name of the table to __user_profiles. So the code will look something like below. Also, check the database tables to see the column and row values.

<?php
$db = JFactory::getDbo();

$query = $db->getQuery(true)
        ->select($db->quoteName(array('profile_key')))
        ->from($db->quoteName('#__user_profiles'));

$db->setQuery($query);

$result = $db->loadObjectList();

foreach ($result as $row) {
if( ($row->profile_key) == "profile.phone")
echo $row->profile_value;
}
?>
3
  • 1
    You may want to think about providing a more up to date database query standard. This is the old method used in J1.5
    – Lodder
    Commented Dec 10, 2015 at 9:21
  • @Lodder Thank you. I corrected the code. I guess this is the way it's used in joomla 3.x
    – zeidanbm
    Commented Dec 10, 2015 at 10:19
  • You shouldn't do that in an article. Just write a simple module. Commented Dec 11, 2015 at 22:03
0

I realise this is old, but I came on it searching for something similar. So here it is:

https://extensions.joomla.org/extensions/extension/clients-a-communities/user-management/frontend-user-manager/

3
  • Thank you for contributing to Q&A. Please avoid posting link-only answers. Take a moment to explain what this extension does and why you believe it is a good idea to use. Commented Dec 23, 2018 at 21:00
  • "Is there and extension/plugin/component available?" Yes. the one mentioned above does exactly what you were looking for three years ago. Simply written and easily customizable. Commented Dec 24, 2018 at 22:23
  • As an edit on your answers instead of a comment please. I don't mean to harass you, your post was flagged by the system as low-quality because of its length and the fact that half of the character count was in the hyperlink. I only mean to help you to create a complete and educational post. Feel free to include any extra features that are nice or mention any drawbacks that you are aware of. Commented Dec 24, 2018 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.