Changeset 1355 for trunk/wp-includes/links.php
- Timestamp:
- 05/24/2004 08:22:18 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/links.php
r1258 r1355 27 27 $show_description = true, $show_rating = false, 28 28 $limit = -1, $show_updated = 0) { 29 global $ tablelinkcategories, $wpdb;29 global $wpdb; 30 30 $cat_id = -1; 31 $results = $wpdb->get_results("SELECT cat_id FROM $ tablelinkcategories WHERE cat_name='$cat_name'");31 $results = $wpdb->get_results("SELECT cat_id FROM $wpdb->linkcategories WHERE cat_name='$cat_name'"); 32 32 if ($results) { 33 33 foreach ($results as $result) { … … 50 50 **/ 51 51 function wp_get_linksbyname($category) { 52 global $wpdb , $tablelinkcategories;52 global $wpdb; 53 53 54 54 $cat = $wpdb->get_row("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, " 55 55 . " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, " 56 . " text_after_all, list_limit FROM $ tablelinkcategories WHERE cat_name='$category'");56 . " text_after_all, list_limit FROM $wpdb->linkcategories WHERE cat_name='$category'"); 57 57 if ($cat) { 58 58 if ($cat->sort_desc == 'Y') { … … 72 72 **/ 73 73 function wp_get_links($category) { 74 global $wpdb , $tablelinkcategories;74 global $wpdb; 75 75 76 76 $cat = $wpdb->get_row("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, " 77 77 . " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, " 78 . " text_after_all, list_limit FROM $ tablelinkcategories WHERE cat_id=$category");78 . " text_after_all, list_limit FROM $wpdb->linkcategories WHERE cat_id=$category"); 79 79 if ($cat) { 80 80 if ($cat->sort_desc == 'Y') { … … 115 115 $limit = -1, $show_updated = 1, $echo = true) { 116 116 117 global $ tablelinks, $wpdb;117 global $wpdb; 118 118 119 119 $direction = ' ASC'; … … 156 156 $sql = "SELECT link_url, link_name, link_image, link_target, 157 157 link_description, link_rating, link_rel $length $recently_updated_test $get_updated 158 FROM $ tablelinks158 FROM $wpdb->links 159 159 WHERE link_visible = 'Y' " . 160 160 $category_query; … … 278 278 **/ 279 279 function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) { 280 global $ tablelinkcategories, $wpdb;280 global $wpdb; 281 281 $cat_id = -1; 282 $results = $wpdb->get_results("SELECT cat_id FROM $ tablelinkcategories WHERE cat_name='$cat_name'");282 $results = $wpdb->get_results("SELECT cat_id FROM $wpdb->linkcategories WHERE cat_name='$cat_name'"); 283 283 if ($results) { 284 284 foreach ($results as $result) { … … 325 325 **/ 326 326 function get_linkobjects($category = -1, $orderby = 'name', $limit = -1) { 327 global $ tablelinks, $wpdb;328 329 $sql = "SELECT * FROM $ tablelinks WHERE link_visible = 'Y'";327 global $wpdb; 328 329 $sql = "SELECT * FROM $wpdb->links WHERE link_visible = 'Y'"; 330 330 if ($category != -1) { 331 331 $sql .= " AND link_category = $category "; … … 460 460 */ 461 461 function get_linkcatname($id = 0) { 462 global $ tablelinkcategories, $wpdb;462 global $wpdb; 463 463 $cat_name = ''; 464 464 if ('' != $id) { 465 $cat_name = $wpdb->get_var("SELECT cat_name FROM $ tablelinkcategories WHERE cat_id=$id");465 $cat_name = $wpdb->get_var("SELECT cat_name FROM $wpdb->linkcategories WHERE cat_id=$id"); 466 466 } 467 467 return stripslashes($cat_name); … … 474 474 */ 475 475 function get_autotoggle($id = 0) { 476 global $ tablelinkcategories, $wpdb;477 $auto_toggle = $wpdb->get_var("SELECT auto_toggle FROM $ tablelinkcategories WHERE cat_id=$id");476 global $wpdb; 477 $auto_toggle = $wpdb->get_var("SELECT auto_toggle FROM $wpdb->linkcategories WHERE cat_id=$id"); 478 478 if ('' == $auto_toggle) 479 479 $auto_toggle = 'N'; … … 493 493 function links_popup_script($text = 'Links', $width=400, $height=400, 494 494 $file='links.all.php', $count = true) { 495 global $tablelinks;496 495 if ($count == true) { 497 $counts = $wpdb->get_var("SELECT count(*) FROM $ tablelinks");496 $counts = $wpdb->get_var("SELECT count(*) FROM $wpdb->links"); 498 497 } 499 498 … … 519 518 * 520 519 * Output a list of all links, listed by category, using the 521 * settings in $ tablelinkcategories and output it as a nested520 * settings in $wpdb->linkcategories and output it as a nested 522 521 * HTML unordered list. 523 522 * … … 527 526 */ 528 527 function get_links_list($order = 'name', $hide_if_empty = 'obsolete') { 529 global $ tablelinkcategories, $tablelinks, $wpdb;528 global $wpdb; 530 529 531 530 $order = strtolower($order); … … 546 545 show_description, show_rating, show_updated, sort_order, 547 546 sort_desc, list_limit 548 FROM `$ tablelinks`549 LEFT JOIN `$ tablelinkcategories` ON (link_category = cat_id)547 FROM `$wpdb->links` 548 LEFT JOIN `$wpdb->linkcategories` ON (link_category = cat_id) 550 549 WHERE link_visible = 'Y' 551 550 AND list_limit <> 0
Note: See TracChangeset
for help on using the changeset viewer.