Changeset 4742
- Timestamp:
- 01/16/2007 03:00:35 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/wordpress.php
r4735 r4742 42 42 global $wpdb, $testing; 43 43 $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY ID"); 44 ?><select name="userselect[<?php echo attribute_escape($n); ?>]">44 ?><select name="userselect[<?php echo $n; ?>]"> 45 45 <option value="#NONE#">- Select -</option> 46 46 <?php … … 101 101 } 102 102 } 103 103 104 // We need to find unique values of author names, while preserving the order, so this function emulates the unique_value(); php function, without the sorting. 104 105 $authors[0] = array_shift($temp); … … 113 114 } 114 115 116 function get_authors_from_post() { 117 $formnames = array (); 118 $selectnames = array (); 119 120 foreach ($_POST['user'] as $key => $line) { 121 $newname = trim(stripslashes($line)); 122 if ($newname == '') 123 $newname = 'left_blank'; //passing author names from step 1 to step 2 is accomplished by using POST. left_blank denotes an empty entry in the form. 124 array_push($formnames, "$newname"); 125 } // $formnames is the array with the form entered names 126 127 foreach ($_POST['userselect'] as $user => $key) { 128 $selected = trim(stripslashes($key)); 129 array_push($selectnames, "$selected"); 130 } 131 132 $count = count($formnames); 133 for ($i = 0; $i < $count; $i ++) { 134 if ($selectnames[$i] != '#NONE#') { //if no name was selected from the select menu, use the name entered in the form 135 array_push($this->newauthornames, "$selectnames[$i]"); 136 } else { 137 array_push($this->newauthornames, "$formnames[$i]"); 138 } 139 } 140 } 141 115 142 function wp_authors_form() { 116 143 ?> … … 128 155 ++ $j; 129 156 echo '<li>'.__('Current author:').' <strong>'.$author.'</strong><br />'.sprintf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30"> <br />'); 130 $this->users_form($ author);157 $this->users_form($j); 131 158 echo '</li>'; 132 159 } … … 281 308 282 309 $this->file = get_attached_file($this->id); 310 $this->get_authors_from_post(); 283 311 $this->get_entries(); 284 312 $this->process_categories();
Note: See TracChangeset
for help on using the changeset viewer.