打印所有用户-Joomla 2.5 [英] Print All Users - 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.
- 以
www.site.com/administrator
身份进入管理员页面. - 以管理员身份登录
- 单击
Users >> User Manager
菜单,然后我可以看到用户列表.
- Go to administrator page as
www.site.com/administrator
. - Login as admin
- 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.
已安装的扩展 Flexi自定义代码.
使用此代码创建模块,在其中添加以上代码,然后在您要显示的菜单上显示该菜单.
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屋!