打印所有用户 - Joomla 2.5 [英] Print All Users - Joomla 2.5

查看:22
本文介绍了打印所有用户 - Joomla 2.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Joomla 的新手.我使用 Joomla 2.5 创建了网站.我有登录页面,这是默认的 Joomla 用户管理系统.

I am new to Joomla. I have created website using Joomla 2.5. I have login page which is default Joomla user management system.

我想要的是以表格格式显示所有用户数据.我怎么能做同样的事情?

What I want is display all user data in a tabular format. How could I do the same?

我可以通过以下步骤查看用户.

I can see the users with below steps.

  1. www.site.com/administrator 身份转到管理员页面.
  2. 以管理员身份登录
  3. 点击<代码>用户>>用户管理器菜单,然后我可以看到用户列表.
  1. Go to administrator page as www.site.com/administrator.
  2. Login as admin
  3. Click Users >> User Manager menu and then I can see the list of users.

我想打印相同的列表,但是在网站上而不是在后端的管理员站点上.

I want to print same list, however on the website and not on administrator site at backend.

推荐答案

您可以这样做,在您想要显示用户列表的页面上运行查询.您可以使用 $row 对象获取所有用户表字段.

you can do this run the query on your page where you want to show user list. you can fetch all users table field with $row object.

$db =& JFactory::getDBO();
$query = "SELECT * FROM #__users" ;
$db->setQuery($query);
$rows = $db->loadObjectList();
foreach ($rows as $row) {
  echo $row->id.'|'.$row->username.'|'.$row->email;
}

编辑 1

以下是我用过的.

Edit 1

Below is what I used.

已安装的扩展 灵活的自定义代码.

使用它创建模块,在其中添加上面的代码,然后在要显示的菜单上显示该菜单.

Create module using this, add above code in it and appear that menu on the menu where you want to display.

这篇关于打印所有用户 - Joomla 2.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆