Changeset 4735 for trunk/wp-admin/import/wordpress.php
- Timestamp:
- 01/16/2007 01:35:19 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/wordpress.php
r4608 r4735 42 42 global $wpdb, $testing; 43 43 $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY ID"); 44 ?><select name="userselect[<?php echo $n; ?>]">44 ?><select name="userselect[<?php echo attribute_escape($n); ?>]"> 45 45 <option value="#NONE#">- Select -</option> 46 46 <?php … … 101 101 } 102 102 } 103 104 103 // 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. 105 104 $authors[0] = array_shift($temp); … … 114 113 } 115 114 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 names126 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 form135 array_push($this->newauthornames, "$selectnames[$i]");136 } else {137 array_push($this->newauthornames, "$formnames[$i]");138 }139 }140 }141 142 115 function wp_authors_form() { 143 116 ?> … … 155 128 ++ $j; 156 129 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 />'); 157 $this->users_form($ j);130 $this->users_form($author); 158 131 echo '</li>'; 159 132 } … … 308 281 309 282 $this->file = get_attached_file($this->id); 310 $this->get_authors_from_post();311 283 $this->get_entries(); 312 284 $this->process_categories();
Note: See TracChangeset
for help on using the changeset viewer.