Changes in trunk/wp-admin/link-import.php [4006:3480]
- File:
-
- 1 edited
-
trunk/wp-admin/link-import.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/link-import.php
r4006 r3480 17 17 include_once('admin-header.php'); 18 18 if ( !current_user_can('manage_links') ) 19 wp_die(__('Cheatin’ uh?'));19 die (__("Cheatin’ uh?")); 20 20 21 21 $opmltype = 'blogrolling'; // default. … … 25 25 <h2><?php _e('Import your blogroll from another system') ?> </h2> 26 26 <form enctype="multipart/form-data" action="link-import.php" method="post" name="blogroll"> 27 <?php wp_nonce_field('import-bookmarks') ?>28 27 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.'); ?> 30 29 <div style="width: 70%; margin: auto; height: 8em;"> 31 30 <input type="hidden" name="step" value="1" /> … … 44 43 </div> 45 44 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 /> 47 46 <?php _e('Category:') ?> <select name="cat_id"> 48 47 <?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"); 50 49 foreach ($categories as $category) { 51 50 ?> 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> 53 52 <?php 54 53 } // end foreach … … 56 55 </select></p> 57 56 58 <p class="submit"><input type="submit" name="submit" value="<?php _e('Import OPML File »') ?>" /></p>57 <p class="submit"><input type="submit" name="submit" value="<?php _e('Import OPML File') ?> »" /></p> 59 58 </form> 60 59 … … 65 64 66 65 case 1: { 67 check_admin_referer('import-bookmarks');68 69 66 include_once('admin-header.php'); 70 67 if ( !current_user_can('manage_links') ) 71 wp_die(__('Cheatin’ uh?'));68 die (__("Cheatin' uh ?")); 72 69 ?> 73 70 <div class="wrap"> … … 90 87 91 88 if ( isset($file['error']) ) 92 wp_die($file['error']);89 die($file['error']); 93 90 94 91 $url = $file['url']; … … 107 104 if ('http' == substr($titles[$i], 0, 4)) 108 105 $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); 111 110 echo sprintf('<p>'.__('Inserted <strong>%s</strong>').'</p>', $names[$i]); 112 111 } 113 112 ?> 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> 115 114 <?php 116 115 } // end if got url
Note: See TracChangeset
for help on using the changeset viewer.