Users tweaks. Still need to add admin user registration.

git-svn-id: http://svn.automattic.com/wordpress/trunk@591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-12-08 08:12:09 +00:00
parent 2917579b95
commit fc6bbfbebb

View File

@ -84,7 +84,7 @@ default:
?>
<div class="wrap">
<h2>Authors</h2>
<table cellpadding="5" cellspacing="0" width="100%">
<table cellpadding="3" cellspacing="3" width="100%">
<tr>
<th>ID</th>
<th>Nickname</th>
@ -106,12 +106,12 @@ default:
$short_url = substr($short_url, 0, -1);
if (strlen($short_url) > 35)
$short_url = substr($short_url, 0, 32).'...';
$bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee';
$style = ('class="alternate"' == $style) ? '' : 'class="alternate"';
$numposts = $wpdb->get_var("SELECT COUNT(*) FROM $tableposts WHERE post_author = $user->ID and post_status = 'publish'");
if (0 < $numposts) $numposts = "<a href='edit.php?author=$user_data->ID' title='View posts'>$numposts</a>";
echo "
<tr style='background-color: $bgcolor'>
<td>$user_data->ID</td>
<tr $style>
<td align='center'>$user_data->ID</td>
<td><strong>$user_data->user_nickname</strong></td>
<td>$user_data->user_firstname $user_data->user_lastname</td>
<td><a href='mailto:$email' title='e-mail: $email'>$email</a></td>
@ -132,51 +132,46 @@ default:
</div>
<?php
$users = $wpdb->get_results("SELECT * FROM $tableusers WHERE user_level=0 ORDER BY ID");
$users = $wpdb->get_results("SELECT * FROM $tableusers WHERE user_level = 0 ORDER BY ID");
if ($users) {
?>
<div class="wrap">
<h2>Users</h2>
<table cellpadding="5" cellspacing="0">
<table cellpadding="3" cellspacing="3" width="100%">
<tr>
<td>ID</td>
<td>Nickname</td>
<td>Name</td>
<td>E-mail</td>
<td>URL</td>
<td>Level</td>
<?php if ($user_level > 3) { ?>
<td>Login</td>
<?php } ?>
<th>ID</th>
<th>Nickname</th>
<th>Name</th>
<th>E-mail</th>
<th>URL</th>
<th>Level</th>
</tr>
<?php
foreach ($users as $user) {
$user_data = get_userdata($user->ID);
echo "<tr>\n<!--".$user_data->user_login."-->\n";
$email = $user_data->user_email;
$url = $user_data->user_url;
$bg1 = ($user_data->user_login == $user_login) ? "style=\"background-image: url('../b2-img/b2button.gif');\"" : "bgcolor=\"#dddddd\"";
$bg2 = ($user_data->user_login == $user_login) ? "style=\"background-image: url('../b2-img/b2button.gif');\"" : "bgcolor=\"#eeeeee\"";
echo "<td $bg1>".$user_data->ID."</td>\n";
echo "<td $bg2><b><a href=\"javascript:profile(".$user_data->ID.")\">".$user_data->user_nickname."</a></b></td>\n";
echo "<td $bg1>".$user_data->user_firstname."&nbsp;".$user_data->user_lastname."</td>\n";
echo "<td $bg1>&nbsp;<a href=\"mailto:".antispambot($email)."\" title=\"e-mail: ".antispambot($email)."\"><img src=\"../b2-img/email.gif\" border=\"0\" alt=\"e-mail: ".antispambot($email)."\" /></a>&nbsp;</td>";
echo "<td $bg2>&nbsp;";
if (($user_data->user_url != "http://") and ($user_data->user_url != ""))
echo "<a href=\"$url\" target=\"_blank\" title=\"website: $url\"><img src=\"../b2-img/url.gif\" border=\"0\" alt=\"website: $url\" /></a>&nbsp;";
echo "</td>\n";
echo "<td $bg1>".$user_data->user_level;
if ($user_level >= 2)
echo " <a href=\"users.php?action=promote&id=".$user_data->ID."&prom=up\">+</a> ";
$short_url = str_replace('http://', '', stripslashes($url));
$short_url = str_replace('www.', '', $short_url);
if ('/' == substr($short_url, -1))
$short_url = substr($short_url, 0, -1);
if (strlen($short_url) > 35)
$short_url = substr($short_url, 0, 32).'...';
$style = ('class="alternate"' == $style) ? '' : 'class="alternate"';
echo "\n<tr $style>
<td align='center'>$user_data->ID</td>
<td><strong>$user_data->user_nickname</td>
<td>$user_data->user_firstname $user_data->user_lastname</td>
<td><a href='mailto:$email' title='e-mail: $email'>$email</a></td>
<td><a href='$url' title='website: $url'>$short_url</a></td>
<td align='center'>";
if ($user_level >= 3)
echo " <a href=\"users.php?action=delete&id=".$user_data->ID."\" style=\"color:red;font-weight:bold;\">X</a> ";
echo "</td>\n";
if ($user_level > 3) {
echo "<td $bg2>".$user_data->user_login."</td>\n";
}
echo "</tr>\n";
echo $user_data->user_level;
if ($user_level >= 2)
echo " <a href=\"users.php?action=promote&id=".$user_data->ID."&prom=up\">+</a> ";
echo "</td>\n</tr>\n";
}
?>
</table>