<?php $issys = isset($_GET['issys']) ? $_GET['issys'] : 0; $s = isset($_GET['s']) ? urldecode($_GET['s']) : ''; $parent_id = isset($_GET['parent_id']) ? absint($_GET['parent_id']) : 0; $parent = ''; if ($parent_id > 0) { global $wpdb; $parent_userlogin = $wpdb->get_var('SELECT user_login FROM ' . $wpdb->users . ' WHERE ID=' . $parent_id); if (!empty($parent_userlogin)) { $parent = serialize(array('id' => (string) $parent_id, 'name' => $parent_userlogin)); } } $_result = query_users(array('user_per_page' => 50, 'page' => isset($_GET['paged']) ? intval($_GET['paged']) : 1, 'isadmin' => 1, 'issys' => $issys, 's' => $s, 'parent' => $parent)); $_users = $_result['users']; ?> <div class="clear" style="margin-top:10px;"> <ul class="subsubsub"> <li><a href="http://<?php echo add_query_arg(array('parent_id' => '', 'issys' => -1, 'paged' => 1, 's' => ''), $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); ?> "<?php echo $issys != -1 ? '' : ' class="current"'; ?> >全部会员</a> |</li> <li><a href="http://<?php echo add_query_arg(array('parent_id' => '', 'issys' => 0, 'paged' => 1, 's' => ''), $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); ?> "<?php echo $issys ? '' : ' class="current"'; ?>
function xt_ajax_search_users() { global $xt_user_follow; $xt_user_param = $_GET; if (isset($xt_user_param['s_index']) && $xt_user_param['page'] > $xt_user_param['s_index'] + 4) { exit('no more'); } unset($xt_user_param['action']); query_users($xt_user_param); $_isScroll = isset($xt_user_param['isScroll']) && "false" == $xt_user_param['isScroll'] ? false : true; $_isCatalog = isset($xt_user_param['isCatalog']) && "false" == $xt_user_param['isCatalog'] ? false : true; get_the_user_container($xt_user_param, $_isCatalog, true, $_isScroll); exit; }
<?php $user = wp_get_current_user(); if (!$user->exists()) { exit('您尚未登录'); } $_result = query_users(array('parent' => serialize(array('id' => (string) $user->ID, 'name' => $user->user_login)), 'parent_id' => $user->ID, 'page' => absint($_POST['page']), 'user_per_page' => 15)); $_users = $_result['users']; $_total = $_result['total']; ?> <table class="table table-striped table-hover table-bordered"> <colgroup> <col style="width:200px;"/> <col/> </colgroup> <thead> <tr> <th>用户名</th> <th>注册时间</th> </tr> </thead> <tbody> <?php if ($_total > 0) { foreach ($_users as $_u) { $_user_registered = gmdate('Y-m-d H:i:s', mysql2date('G', $_u->user_registered) + get_option('gmt_offset') * 3600); echo "<tr><td class=\"xt-td-center\">{$_u->user_login}</td><td class=\"xt-td-center\">{$_user_registered}</td></tr>"; } } ?>