*/ $b2varstoreset = array('action','standalone','redirect','profile'); for ($i=0; $iuser_level; if ($user_level <= $usertopromote_level) { die('Can’t change the level of a user whose level is higher than yours.'); } if ('up' == $prom) { $sql="UPDATE $tableusers SET user_level=user_level+1 WHERE ID = $id"; } elseif ('down' == $prom) { $sql="UPDATE $tableusers SET user_level=user_level-1 WHERE ID = $id"; } $result = $wpdb->query($sql); header('Location: users.php'); break; case 'delete': $standalone = 1; require_once('b2header.php'); $id = $HTTP_GET_VARS['id']; if (!$id) { header('Location: users.php'); } $user_data = get_userdata($id); $usertodelete_level = $user_data->user_level; if ($user_level <= $usertodelete_level) die('Can’t delete a user whose level is higher than yours.'); $sql = "DELETE FROM $tableusers WHERE ID = $id"; $result = $wpdb->query($sql) or die("Couldn’t delete user #$id."); $sql = "DELETE FROM $tableposts WHERE post_author = $id"; $result = $wpdb->query($sql) or die("Couldn’t delete user #$id’s posts."); header('Location: users.php'); break; default: $standalone = 0; include ('b2header.php'); ?>

Authors

get_results("SELECT ID FROM $tableusers WHERE user_level > 0 ORDER BY ID"); foreach ($users as $user) { $user_data = get_userdata($user->ID); $email = $user_data->user_email; $url = $user_data->user_url; $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).'...'; $bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee'; $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $tableposts WHERE post_author = $user->ID and post_status = 'publish'"); if (0 < $numposts) $numposts = "$numposts"; echo " "; echo ''; } ?>
ID Nickname Name E-mail URL Level Posts
$user_data->ID $user_data->user_nickname $user_data->user_firstname $user_data->user_lastname $email $short_url "; if (($user_level >= 2) and ($user_level > $user_data->user_level) and ($user_data->user_level > 0)) echo " ID."&prom=down\">- "; echo $user_data->user_level; if (($user_level >= 2) and ($user_level > ($user_data->user_level + 1))) echo " ID."&prom=up\">+ "; echo "$numposts
get_results("SELECT * FROM $tableusers WHERE user_level=0 ORDER BY ID"); if ($users) { ?>

Users

3) { ?> ID); echo "\n\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 "\n"; echo "\n"; echo "\n"; echo ""; echo "\n"; echo "\n"; if ($user_level > 3) { echo "\n"; } echo "\n"; } ?>
ID Nickname Name E-mail URL Level Login
".$user_data->ID."ID.")\">".$user_data->user_nickname."".$user_data->user_firstname." ".$user_data->user_lastname." \"e-mail:  "; if (($user_data->user_url != "http://") and ($user_data->user_url != "")) echo "\"website: "; echo "".$user_data->user_level; if ($user_level >= 2) echo " ID."&prom=up\">+ "; if ($user_level >= 3) echo " ID."\" style=\"color:red;font-weight:bold;\">X "; echo "".$user_data->user_login."

To delete a user, bring his level to zero, then click on the red X.
Warning: deleting a user also deletes all posts made by this user.

Add User

Users can register themselves or you can manually create users here.

*/ include('b2footer.php'); ?>