Make WordPress Core


Ignore:
Timestamp:
02/27/2006 04:57:30 AM (18 years ago)
Author:
ryan
Message:

Bookmark/link rework. #2499

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/link-import.php

    r3541 r3570  
    2626<form enctype="multipart/form-data" action="link-import.php" method="post" name="blogroll">
    2727
    28 <p><?php _e('If a program or website you use allows you to export your links or subscriptions as OPML you may import them here.'); ?>
     28<p><?php _e('If a program or website you use allows you to export your bookmarks or subscriptions as OPML you may import them here.'); ?>
    2929<div style="width: 70%; margin: auto; height: 8em;">
    3030<input type="hidden" name="step" value="1" />
     
    4343</div>
    4444
    45 <p style="clear: both; margin-top: 1em;"><?php _e('Now select a category you want to put these links in.') ?><br />
     45<p style="clear: both; margin-top: 1em;"><?php _e('Now select a category you want to put these bookmarks in.') ?><br />
    4646<?php _e('Category:') ?> <select name="cat_id">
    4747<?php
    48 $categories = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $wpdb->linkcategories ORDER BY cat_id");
     48$categories = get_categories('hide_empty=0');
    4949foreach ($categories as $category) {
    5050?>
    51 <option value="<?php echo $category->cat_id; ?>"><?php echo $category->cat_id.': '.$category->cat_name; ?></option>
     51<option value="<?php echo $category->cat_ID; ?>"><?php echo wp_specialchars($category->cat_name); ?></option>
    5252<?php
    5353} // end foreach
     
    104104                        if ('http' == substr($titles[$i], 0, 4))
    105105                            $titles[$i] = '';
    106                         // FIXME:  Use wp_insert_link().
    107                         $query = "INSERT INTO $wpdb->links (link_url, link_name, link_target, link_category, link_description, link_owner, link_rss)
    108                                 VALUES('{$urls[$i]}', '".$wpdb->escape($names[$i])."', '', $cat_id, '".$wpdb->escape($descriptions[$i])."', $user_ID, '{$feeds[$i]}')\n";
    109                         $result = $wpdb->query($query);
     106                        $link = array( 'link_url' => $urls[$i], 'link_name' => $wpdb->escape($names[$i]), 'link_category' => array($cat_id), 'link_description' => $wpdb->escape($descriptions[$i]), 'link_owner' => $user_ID, 'link_rss' => $feeds[$i]);                       
     107                        wp_insert_link($link);
    110108                        echo sprintf('<p>'.__('Inserted <strong>%s</strong>').'</p>', $names[$i]);
    111109                    }
    112110?>
    113      <p><?php printf(__('Inserted %1$d links into category %2$s. All done! Go <a href="%3$s">manage those links</a>.'), $link_count, $cat_id, 'link-manager.php') ?></p>
     111     <p><?php printf(__('Inserted %1$d bookmarks into category %2$s. All done! Go <a href="%3$s">manage those bookmarks</a>.'), $link_count, $cat_id, 'link-manager.php') ?></p>
    114112<?php
    115113                } // end if got url
Note: See TracChangeset for help on using the changeset viewer.