Typecho 用户管理页面添加注册和访问时间

引言

注册端口打开了,难免有些人不会珍惜,看看自己有哪些僵尸粉也是不错的,如果直接查数据库,格林威治时间戳玩的头疼,所以直接显示在前端页面上吧。

实操

找到根目录的admin/manage-users.php文件,打开并且编辑。我直接把我的表格给扔过来了,怎么改看自己的需求吧。

<table class="typecho-list-table">
    <colgroup>
        <col width="15" />
        <col width="6%" />
        <col width="15%" />
        <col width="" />
        <col width="20%" />
        <col width="10%" />


        <col width="15%" />
        <col width="15%" />
    </colgroup>
    <thead>
        <tr>
            <th> </th>
            <th> </th>
            <th><?php _e('用户名'); ?></th>
            <th><?php _e('昵称'); ?></th>
            <th><?php _e('电子邮件'); ?></th>
            <th><?php _e('用户组'); ?></th>



            <th><?php _e('创建时间'); ?></th>
            <th><?php _e('最后登陆'); ?></th>



        </tr>
    </thead>
    <tbody>
        <?php Typecho_Widget::widget('Widget_Users_Admin')->to($users); ?>
        <?php while ($users->next()) : ?>
            <tr id="user-<?php $users->uid(); ?>">
                <td><input type="checkbox" value="<?php $users->uid(); ?>" name="uid[]" /></td>
                <td><a href="<?php $options->adminUrl('manage-posts.php?uid=' . $users->uid); ?>" class="balloon-button left size-<?php echo Typecho_Common::splitByCount($users->postsNum, 1, 10, 20, 50, 100); ?>"><?php $users->postsNum(); ?></a></td>
                <td><a href="<?php $options->adminUrl('user.php?uid=' . $users->uid); ?>"><?php $users->name(); ?></a>
                    <a href="<?php $users->permalink(); ?>" title="<?php _e('浏览 %s', $users->screenName); ?>"><i class="i-exlink"></i></a>
                </td>
                <td><?php $users->screenName(); ?></td>
                <td><?php if ($users->mail) : ?><a href="mailto:<?php $users->mail(); ?>"><?php $users->mail(); ?></a><?php else : _e('暂无');
                                                                                                                endif; ?></td>
                <td><?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;
                    } ?> </td>



                <td><?php
                    echo date('Y-m-d H:i:s', $users->created);
                    ?> </td>
                <td><?php
                    if ($users->activated == '0') {
                        echo "---";
                    } else {
                        echo date('Y-m-d H:i:s', $users->activated);
                    }
                    ?> </td>


            </tr>
        <?php endwhile; ?>
    </tbody>
</table><!-- end .typecho-list-table -->

评论 0

还没有评论,来说点什么吧。

提交后需要审核才会公开。