Changeset 1355 for trunk/wp-admin/users.php
- Timestamp:
- 05/24/2004 08:22:18 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/users.php
r1303 r1355 56 56 57 57 /* checking the login isn't already used by another user */ 58 $loginthere = $wpdb->get_var("SELECT user_login FROM $ tableusers WHERE user_login = '$user_login'");58 $loginthere = $wpdb->get_var("SELECT user_login FROM $wpdb->users WHERE user_login = '$user_login'"); 59 59 if ($loginthere) { 60 60 die (__('<strong>ERROR</strong>: This login is already registered, please choose another one.')); … … 79 79 $new_users_can_blog = get_settings('new_users_can_blog'); 80 80 81 $result = $wpdb->query("INSERT INTO $ tableusers81 $result = $wpdb->query("INSERT INTO $wpdb->users 82 82 (user_login, user_pass, user_nickname, user_email, user_ip, user_domain, user_browser, dateYMDhour, user_level, user_idmode, user_firstname, user_lastname, user_nicename) 83 83 VALUES … … 123 123 if ('up' == $prom) { 124 124 $new_level = $usertopromote_level + 1; 125 $sql="UPDATE $ tableusers SET user_level=$new_level WHERE ID = $id AND $new_level < $user_level";125 $sql="UPDATE $wpdb->users SET user_level=$new_level WHERE ID = $id AND $new_level < $user_level"; 126 126 } elseif ('down' == $prom) { 127 127 $new_level = $usertopromote_level - 1; 128 $sql="UPDATE $ tableusers SET user_level=$new_level WHERE ID = $id AND $new_level < $user_level";128 $sql="UPDATE $wpdb->users SET user_level=$new_level WHERE ID = $id AND $new_level < $user_level"; 129 129 } 130 130 $result = $wpdb->query($sql); … … 153 153 die(__('Can’t delete a user whose level is higher than yours.')); 154 154 155 $post_ids = $wpdb->get_col("SELECT ID FROM $ tableposts WHERE post_author = $id");155 $post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_author = $id"); 156 156 if ($post_ids) { 157 157 $post_ids = implode(',', $post_ids); 158 158 159 159 // Delete comments, *backs 160 $wpdb->query("DELETE FROM $ tablecomments WHERE comment_post_ID IN ($post_ids)");160 $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_post_ID IN ($post_ids)"); 161 161 // Clean cats 162 $wpdb->query("DELETE FROM $ tablepost2cat WHERE post_id IN ($post_ids)");162 $wpdb->query("DELETE FROM $wpdb->post2cat WHERE post_id IN ($post_ids)"); 163 163 // Clean post_meta 164 $wpdb->query("DELETE FROM $ tablepostmeta WHERE post_id IN ($post_ids)");164 $wpdb->query("DELETE FROM $wpdb->postmeta WHERE post_id IN ($post_ids)"); 165 165 // Clean links 166 $wpdb->query("DELETE FROM $ tablelinks WHERE link_owner = $id");166 $wpdb->query("DELETE FROM $wpdb->links WHERE link_owner = $id"); 167 167 // Delete posts 168 $wpdb->query("DELETE FROM $ tableposts WHERE post_author = $id");168 $wpdb->query("DELETE FROM $wpdb->posts WHERE post_author = $id"); 169 169 } 170 170 171 171 // FINALLY, delete user 172 $wpdb->query("DELETE FROM $ tableusers WHERE ID = $id");172 $wpdb->query("DELETE FROM $wpdb->users WHERE ID = $id"); 173 173 header('Location: users.php?deleted=true'); 174 174 … … 196 196 </tr> 197 197 <?php 198 $users = $wpdb->get_results("SELECT ID FROM $ tableusers WHERE user_level > 0 ORDER BY ID");198 $users = $wpdb->get_results("SELECT ID FROM $wpdb->users WHERE user_level > 0 ORDER BY ID"); 199 199 $style = ''; 200 200 foreach ($users as $user) { … … 209 209 $short_url = substr($short_url, 0, 32).'...'; 210 210 $style = ('class="alternate"' == $style) ? '' : 'class="alternate"'; 211 $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $ tableposts WHERE post_author = $user->ID and post_status = 'publish'");211 $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = $user->ID and post_status = 'publish'"); 212 212 if (0 < $numposts) $numposts = "<a href='edit.php?author=$user_data->ID' title='" . __('View posts') . "'>$numposts</a>"; 213 213 echo " … … 234 234 235 235 <?php 236 $users = $wpdb->get_results("SELECT * FROM $ tableusers WHERE user_level = 0 ORDER BY ID");236 $users = $wpdb->get_results("SELECT * FROM $wpdb->users WHERE user_level = 0 ORDER BY ID"); 237 237 if ($users) { 238 238 ?>
Note: See TracChangeset
for help on using the changeset viewer.