typecho输出所有用户的信息

在某个页面输出所有用户的信息,如上图效果

方法入下,在独立页面模板中加入以下代码

<colgroup> <col width="20" /> <col width="6%" /> <col width="30%" /> <col width="" /> <col width="25%" /> <col width="15%" /> </colgroup> <?php Typecho_Widget::widget('Widget_Users_Admin')->to($users); ?> <?php while($users->next()): ?> <?php $users->name(); ?> <?php endwhile; ?>
<?php _e('用户名'); ?> <?php _e('昵称'); ?> <?php _e('电子邮件'); ?> <?php _e('用户组'); ?>
<?php $users->screenName(); ?> <?php if($users->mail): ?><a href="mailto:<?php $users->mail(); ?>"> <?php $users->mail(); ?> <?php else: _e('暂无'); endif; ?> <?php switch ($users->group) { case 'administrator': _e('管理员'); break; case 'editor': _e('编辑'); break; case 'contributor': _e('贡献者'); break; case 'subscriber': _e('关注者'); break; case 'visitor': _e('访问者'); break; default: break; } ?>
<!-- end .typecho-list-table -->
文章由官网发布,如若转载,请注明出处:https://www.veimoz.com/51
0 评论
2k

发表评论

!