Make WordPress Core


Ignore:
Timestamp:
05/24/2004 08:22:18 AM (21 years ago)
Author:
saxmatt
Message:

Giant commit, sorry mailing list people. Move all table names to new $wpdb versions. Works but the whole app needs thorough testing now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/links.php

    r1258 r1355  
    2727                         $show_description = true, $show_rating = false,
    2828                         $limit = -1, $show_updated = 0) {
    29     global $tablelinkcategories, $wpdb;
     29    global $wpdb;
    3030    $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'");
    3232    if ($results) {
    3333        foreach ($results as $result) {
     
    5050 **/
    5151function wp_get_linksbyname($category) {
    52     global $wpdb, $tablelinkcategories;
     52    global $wpdb;
    5353
    5454    $cat = $wpdb->get_row("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, "
    5555         . " 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'");
    5757    if ($cat) {
    5858        if ($cat->sort_desc == 'Y') {
     
    7272 **/
    7373function wp_get_links($category) {
    74     global $wpdb, $tablelinkcategories;
     74    global $wpdb;
    7575
    7676    $cat = $wpdb->get_row("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, "
    7777         . " 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");
    7979    if ($cat) {
    8080        if ($cat->sort_desc == 'Y') {
     
    115115                   $limit = -1, $show_updated = 1, $echo = true) {
    116116
    117     global $tablelinks, $wpdb;
     117    global $wpdb;
    118118
    119119    $direction = ' ASC';
     
    156156    $sql = "SELECT link_url, link_name, link_image, link_target,
    157157            link_description, link_rating, link_rel $length $recently_updated_test $get_updated
    158             FROM $tablelinks
     158            FROM $wpdb->links
    159159            WHERE link_visible = 'Y' " .
    160160           $category_query;
     
    278278 **/
    279279function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) {
    280     global $tablelinkcategories, $wpdb;
     280    global $wpdb;
    281281    $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'");
    283283    if ($results) {
    284284        foreach ($results as $result) {
     
    325325 **/
    326326function 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'";
    330330    if ($category != -1) {
    331331        $sql .= " AND link_category = $category ";
     
    460460 */
    461461function get_linkcatname($id = 0) {
    462     global $tablelinkcategories, $wpdb;
     462    global $wpdb;
    463463    $cat_name = '';
    464464    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");
    466466    }
    467467    return stripslashes($cat_name);
     
    474474 */
    475475function 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");
    478478    if ('' == $auto_toggle)
    479479        $auto_toggle = 'N';
     
    493493function links_popup_script($text = 'Links', $width=400, $height=400,
    494494                            $file='links.all.php', $count = true) {
    495    global $tablelinks;
    496495   if ($count == true) {
    497       $counts = $wpdb->get_var("SELECT count(*) FROM $tablelinks");
     496      $counts = $wpdb->get_var("SELECT count(*) FROM $wpdb->links");
    498497   }
    499498
     
    519518 *
    520519 * Output a list of all links, listed by category, using the
    521  * settings in $tablelinkcategories and output it as a nested
     520 * settings in $wpdb->linkcategories and output it as a nested
    522521 * HTML unordered list.
    523522 *
     
    527526 */
    528527function get_links_list($order = 'name', $hide_if_empty = 'obsolete') {
    529     global $tablelinkcategories, $tablelinks, $wpdb;
     528    global $wpdb;
    530529
    531530    $order = strtolower($order);
     
    546545            show_description, show_rating, show_updated, sort_order,
    547546            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)
    550549        WHERE link_visible =  'Y'
    551550            AND list_limit <> 0
Note: See TracChangeset for help on using the changeset viewer.