Changeset 3570 for trunk/wp-admin/link-import.php
- Timestamp:
- 02/27/2006 04:57:30 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/link-import.php
r3541 r3570 26 26 <form enctype="multipart/form-data" action="link-import.php" method="post" name="blogroll"> 27 27 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.'); ?> 29 29 <div style="width: 70%; margin: auto; height: 8em;"> 30 30 <input type="hidden" name="step" value="1" /> … … 43 43 </div> 44 44 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 /> 46 46 <?php _e('Category:') ?> <select name="cat_id"> 47 47 <?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'); 49 49 foreach ($categories as $category) { 50 50 ?> 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> 52 52 <?php 53 53 } // end foreach … … 104 104 if ('http' == substr($titles[$i], 0, 4)) 105 105 $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); 110 108 echo sprintf('<p>'.__('Inserted <strong>%s</strong>').'</p>', $names[$i]); 111 109 } 112 110 ?> 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> 114 112 <?php 115 113 } // end if got url
Note: See TracChangeset
for help on using the changeset viewer.