Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r4006 r3480  
    1717        include_once('admin-header.php');
    1818        if ( !current_user_can('manage_links') )
    19             wp_die(__('Cheatin’ uh?'));
     19            die (__("Cheatin’ uh?"));
    2020
    2121        $opmltype = 'blogrolling'; // default.
     
    2525<h2><?php _e('Import your blogroll from another system') ?> </h2>
    2626<form enctype="multipart/form-data" action="link-import.php" method="post" name="blogroll">
    27 <?php wp_nonce_field('import-bookmarks') ?>
    2827
    29 <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.'); ?>
     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.'); ?>
    3029<div style="width: 70%; margin: auto; height: 8em;">
    3130<input type="hidden" name="step" value="1" />
     
    4443</div>
    4544
    46 <p style="clear: both; margin-top: 1em;"><?php _e('Now select a category you want to put these bookmarks in.') ?><br />
     45<p style="clear: both; margin-top: 1em;"><?php _e('Now select a category you want to put these links in.') ?><br />
    4746<?php _e('Category:') ?> <select name="cat_id">
    4847<?php
    49 $categories = get_categories('hide_empty=0');
     48$categories = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $wpdb->linkcategories ORDER BY cat_id");
    5049foreach ($categories as $category) {
    5150?>
    52 <option value="<?php echo $category->cat_ID; ?>"><?php echo wp_specialchars($category->cat_name); ?></option>
     51<option value="<?php echo $category->cat_id; ?>"><?php echo $category->cat_id.': '.$category->cat_name; ?></option>
    5352<?php
    5453} // end foreach
     
    5655</select></p>
    5756
    58 <p class="submit"><input type="submit" name="submit" value="<?php _e('Import OPML File &raquo;') ?>" /></p>
     57<p class="submit"><input type="submit" name="submit" value="<?php _e('Import OPML File') ?> &raquo;" /></p>
    5958</form>
    6059
     
    6564
    6665    case 1: {
    67         check_admin_referer('import-bookmarks');
    68 
    6966                include_once('admin-header.php');
    7067                if ( !current_user_can('manage_links') )
    71                     wp_die(__('Cheatin&#8217; uh?'));
     68                    die (__("Cheatin' uh ?"));
    7269?>
    7370<div class="wrap">
     
    9087
    9188                    if ( isset($file['error']) )
    92                         wp_die($file['error']);
     89                        die($file['error']);
    9390
    9491                    $url = $file['url'];
     
    107104                        if ('http' == substr($titles[$i], 0, 4))
    108105                            $titles[$i] = '';
    109                         $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]);                       
    110                         wp_insert_link($link);
     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);
    111110                        echo sprintf('<p>'.__('Inserted <strong>%s</strong>').'</p>', $names[$i]);
    112111                    }
    113112?>
    114      <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>
     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>
    115114<?php
    116115                } // end if got url
Note: See TracChangeset for help on using the changeset viewer.