Changeset 1355 for trunk/wp-admin/link-manager.php
- Timestamp:
- 05/24/2004 08:22:18 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/link-manager.php
r1352 r1355 21 21 22 22 function category_dropdown($fieldname, $selected = 0) { 23 global $wpdb , $tablelinkcategories;23 global $wpdb; 24 24 25 $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $ tablelinkcategories ORDER BY cat_id");25 $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $wpdb->linkcategories ORDER BY cat_id"); 26 26 echo "\n<select name='$fieldname' size='1'>"; 27 27 foreach ($results as $row) { … … 100 100 } 101 101 $all_links = join(',', $linkcheck); 102 $results = $wpdb->get_results("SELECT link_id, link_owner, user_level FROM $ tablelinks LEFT JOIN $tableusers ON link_owner = ID WHERE link_id in ($all_links)");102 $results = $wpdb->get_results("SELECT link_id, link_owner, user_level FROM $wpdb->links LEFT JOIN $wpdb->users ON link_owner = ID WHERE link_id in ($all_links)"); 103 103 foreach ($results as $row) { 104 104 if (!get_settings('links_use_adminlevels') || ($user_level >= $row->user_level)) { // ok to proceed … … 109 109 // should now have an array of links we can change 110 110 $all_links = join(',', $ids_to_change); 111 $q = $wpdb->query("update $ tablelinks SET link_owner='$newowner' WHERE link_id IN ($all_links)");111 $q = $wpdb->query("update $wpdb->links SET link_owner='$newowner' WHERE link_id IN ($all_links)"); 112 112 113 113 header('Location: ' . $this_file); … … 131 131 } 132 132 $all_links = join(',', $linkcheck); 133 $results = $wpdb->get_results("SELECT link_id, link_visible FROM $ tablelinks WHERE link_id in ($all_links)");133 $results = $wpdb->get_results("SELECT link_id, link_visible FROM $wpdb->links WHERE link_id in ($all_links)"); 134 134 foreach ($results as $row) { 135 135 if ($row->link_visible == 'Y') { // ok to proceed … … 143 143 if (count($ids_to_turnoff)) { 144 144 $all_linksoff = join(',', $ids_to_turnoff); 145 $q = $wpdb->query("update $ tablelinks SET link_visible='N' WHERE link_id IN ($all_linksoff)");145 $q = $wpdb->query("update $wpdb->links SET link_visible='N' WHERE link_id IN ($all_linksoff)"); 146 146 } 147 147 148 148 if (count($ids_to_turnon)) { 149 149 $all_linkson = join(',', $ids_to_turnon); 150 $q = $wpdb->query("update $ tablelinks SET link_visible='Y' WHERE link_id IN ($all_linkson)");150 $q = $wpdb->query("update $wpdb->links SET link_visible='Y' WHERE link_id IN ($all_linkson)"); 151 151 } 152 152 … … 172 172 $all_links = join(',', $linkcheck); 173 173 // should now have an array of links we can change 174 $q = $wpdb->query("update $ tablelinks SET link_category='$category' WHERE link_id IN ($all_links)");174 $q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)"); 175 175 176 176 header('Location: ' . $this_file); … … 204 204 // need to make the others invisible before we add this new one. 205 205 if (($auto_toggle == 'Y') && ($link_visible == 'Y')) { 206 $wpdb->query("UPDATE $ tablelinks set link_visible = 'N' WHERE link_category = $link_category");207 } 208 $wpdb->query("INSERT INTO $ tablelinks (link_url, link_name, link_image, link_target, link_category, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) " .206 $wpdb->query("UPDATE $wpdb->links set link_visible = 'N' WHERE link_category = $link_category"); 207 } 208 $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_category, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) " . 209 209 " VALUES('" . addslashes($link_url) . "','" 210 210 . addslashes($link_name) . "', '" … … 254 254 // need to make the others invisible before we update this one. 255 255 if (($auto_toggle == 'Y') && ($link_visible == 'Y')) { 256 $wpdb->query("UPDATE $ tablelinks set link_visible = 'N' WHERE link_category = $link_category");256 $wpdb->query("UPDATE $wpdb->links set link_visible = 'N' WHERE link_category = $link_category"); 257 257 } 258 258 259 $wpdb->query("UPDATE $ tablelinks SET link_url='" . addslashes($link_url) . "',259 $wpdb->query("UPDATE $wpdb->links SET link_url='" . addslashes($link_url) . "', 260 260 link_name='" . addslashes($link_name) . "',\n link_image='" . addslashes($link_image) . "', 261 261 link_target='$link_target',\n link_category=$link_category, … … 284 284 die (__("Cheatin' uh ?")); 285 285 286 $wpdb->query("DELETE FROM $ tablelinks WHERE link_id = $link_id");286 $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = $link_id"); 287 287 288 288 if (isset($links_show_cat_id) && ($links_show_cat_id != '')) … … 309 309 310 310 $row = $wpdb->get_row("SELECT * 311 FROM $ tablelinks311 FROM $wpdb->links 312 312 WHERE link_id = $link_id"); 313 313 … … 618 618 <td> 619 619 <?php 620 $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $ tablelinkcategories ORDER BY cat_id");620 $results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $wpdb->linkcategories ORDER BY cat_id"); 621 621 echo " <select name=\"cat_id\">\n"; 622 622 echo " <option value=\"All\""; … … 676 676 <?php 677 677 $sql = "SELECT link_url, link_name, link_image, link_description, link_visible, 678 link_category AS cat_id, cat_name AS category, $ tableusers.user_login, link_id,679 link_rating, link_rel, $ tableusers.user_level680 FROM $ tablelinks681 LEFT JOIN $ tablelinkcategories ON $tablelinks.link_category = $tablelinkcategories.cat_id682 LEFT JOIN $ tableusers ON $tableusers.ID = $tablelinks.link_owner ";678 link_category AS cat_id, cat_name AS category, $wpdb->users.user_login, link_id, 679 link_rating, link_rel, $wpdb->users.user_level 680 FROM $wpdb->links 681 LEFT JOIN $wpdb->linkcategories ON $wpdb->links.link_category = $wpdb->linkcategories.cat_id 682 LEFT JOIN $wpdb->users ON $wpdb->users.ID = $wpdb->links.link_owner "; 683 683 684 684 if (isset($cat_id) && ($cat_id != 'All')) { … … 748 748 <?php _e('Assign ownership to:'); echo ' ' . gethelp_link($this_file,'assign_ownership'); ?> 749 749 <?php 750 $results = $wpdb->get_results("SELECT ID, user_login FROM $ tableusers WHERE user_level > 0 ORDER BY ID");750 $results = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users WHERE user_level > 0 ORDER BY ID"); 751 751 echo " <select name=\"newowner\" size=\"1\">\n"; 752 752 foreach ($results as $row) {
Note: See TracChangeset
for help on using the changeset viewer.