Changes from tags/2.0.10 at r5675 to branches/2.0 at r5675
- Location:
- branches/2.0
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/wp-admin/admin-functions.php
r5675 r5675 320 320 $comment = get_comment($id); 321 321 322 $comment->comment_content = format_to_edit($comment->comment_content, $richedit); 322 $comment->comment_ID = (int) $comment->comment_ID; 323 $comment->comment_post_ID = (int) $comment->comment_post_ID; 324 325 $comment->comment_content = format_to_edit($comment->comment_content); 323 326 $comment->comment_content = apply_filters('comment_edit_pre', $comment->comment_content); 324 327 325 328 $comment->comment_author = format_to_edit($comment->comment_author); 326 329 $comment->comment_author_email = format_to_edit($comment->comment_author_email); 330 $comment->comment_author_url = clean_url($comment->comment_author_url); 327 331 $comment->comment_author_url = format_to_edit($comment->comment_author_url); 328 332 … … 863 867 $entry['meta_key'] = attribute_escape( $entry['meta_key']); 864 868 $entry['meta_value'] = attribute_escape( $entry['meta_value']); 869 $entry['meta_id'] = (int) $entry['meta_id']; 865 870 echo " 866 871 <tr class='$style'> … … 1814 1819 </script> 1815 1820 <form enctype="multipart/form-data" id="uploadForm" method="post" action="<?php echo attribute_escape($action) ?>"> 1821 <?php wp_nonce_field('import-upload'); ?> 1816 1822 <label for="upload"><?php _e('File:'); ?></label><input type="file" id="upload" name="import" /> 1817 1823 <input type="hidden" name="action" value="save" /> -
branches/2.0/wp-admin/edit-form-advanced.php
r5675 r5675 1 1 <?php 2 if ( isset($_GET['message']) ) 3 $_GET['message'] = (int) $_GET['message']; 2 4 $messages[1] = __('Post updated'); 3 5 $messages[2] = __('Custom field updated'); … … 5 7 ?> 6 8 <?php if (isset($_GET['message'])) : ?> 7 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>9 <div id="message" class="updated fade"><p><?php echo wp_specialchars($messages[$_GET['message']]); ?></p></div> 8 10 <?php endif; ?> 9 11 … … 25 27 wp_nonce_field('add-post'); 26 28 } else { 29 $post_ID = (int) $post_ID; 27 30 $form_action = 'editpost'; 28 31 $form_extra = "<input type='hidden' name='post_ID' value='$post_ID' />"; … … 30 33 } 31 34 32 $form_pingback = '<input type="hidden" name="post_pingback" value="' . get_option('default_pingback_flag') . '" id="post_pingback" />';33 34 $form_prevstatus = '<input type="hidden" name="prev_status" value="' . $post->post_status . '" />';35 36 $form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $post->to_ping) .'" />';35 $form_pingback = '<input type="hidden" name="post_pingback" value="' . (int) get_option('default_pingback_flag') . '" id="post_pingback" />'; 36 37 $form_prevstatus = '<input type="hidden" name="prev_status" value="' . attribute_escape( $post->post_status ) . '" />'; 38 39 $form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />'; 37 40 38 41 if ('' != $post->pinged) { … … 45 48 } 46 49 47 $saveasdraft = '<input name="save" type="submit" id="save" tabindex="3" value="' . __('Save and Continue Editing') . '" />';50 $saveasdraft = '<input name="save" type="submit" id="save" tabindex="3" value="' . attribute_escape(__('Save and Continue Editing')) . '" />'; 48 51 49 52 if (empty($post->post_status)) $post->post_status = 'draft'; … … 51 54 ?> 52 55 53 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />56 <input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" /> 54 57 <input type="hidden" name="action" value="<?php echo $form_action ?>" /> 55 <input type="hidden" name="post_author" value="<?php echo $post->post_author?>" />58 <input type="hidden" name="post_author" value="<?php echo attribute_escape($post->post_author) ?>" /> 56 59 57 60 <?php echo $form_extra ?> … … 83 86 <fieldset id="passworddiv" class="dbx-box"> 84 87 <h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3> 85 <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password?>" /></div>88 <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo attribute_escape($post->post_password) ?>" /></div> 86 89 </fieldset> 87 90 88 91 <fieldset id="slugdiv" class="dbx-box"> 89 92 <h3 class="dbx-handle"><?php _e('Post slug') ?></h3> 90 <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name?>" /></div>93 <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape($post->post_name) ?>" /></div> 91 94 </fieldset> 92 95 … … 124 127 if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"'; 125 128 else $selected = ''; 126 echo "<option value=' $o->ID' $selected>$o->display_name</option>";129 echo "<option value='" . (int) $o->ID . "' $selected>" . wp_specialchars($o->display_name) . "</option>"; 127 130 endforeach; 128 131 ?> … … 139 142 <fieldset id="titlediv"> 140 143 <legend><?php _e('Title') ?></legend> 141 <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>144 <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" /></div> 142 145 </fieldset> 143 146 … … 222 225 <?php 223 226 if (current_user_can('upload_files')) { 224 $uploading_iframe_ID = ( 0 == $post_ID ? $temp_ID : $post_ID);227 $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID); 225 228 $uploading_iframe_src = wp_nonce_url("inline-uploading.php?action=view&post=$uploading_iframe_ID", 'inlineuploading'); 226 229 $uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src); -
branches/2.0/wp-admin/edit-form-comment.php
r5675 r5675 9 9 <?php wp_nonce_field('update-comment_' . $comment->comment_ID) ?> 10 10 <div class="wrap"> 11 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />11 <input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" /> 12 12 <input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' /> 13 13 … … 21 21 <legend><?php _e('Name:') ?></legend> 22 22 <div> 23 <input type="text" name="newcomment_author" size="22" value="<?php echo $comment->comment_author?>" tabindex="1" id="name" />23 <input type="text" name="newcomment_author" size="22" value="<?php echo attribute_escape($comment->comment_author); ?>" tabindex="1" id="name" /> 24 24 </div> 25 25 </fieldset> … … 27 27 <legend><?php _e('E-mail:') ?></legend> 28 28 <div> 29 <input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email?>" tabindex="2" id="email" />29 <input type="text" name="newcomment_author_email" size="30" value="<?php echo attribute_escape($comment->comment_author_email); ?>" tabindex="2" id="email" /> 30 30 </div> 31 31 </fieldset> … … 33 33 <legend><?php _e('URI:') ?></legend> 34 34 <div> 35 <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo $comment->comment_author_url?>" tabindex="3" id="URL" />35 <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo attribute_escape($comment->comment_author_url); ?>" tabindex="3" id="URL" /> 36 36 </div> 37 37 </fieldset> -
branches/2.0/wp-admin/edit-form.php
r5675 r5675 7 7 <input type="hidden" name="mode" value="bookmarklet" /> 8 8 <?php endif; ?> 9 <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />9 <input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" /> 10 10 <input type="hidden" name="action" value='post' /> 11 11 … … 22 22 <fieldset id="titlediv"> 23 23 <legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend> 24 <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>24 <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" /></div> 25 25 </fieldset> 26 26 … … 50 50 </script> 51 51 52 <input type="hidden" name="post_pingback" value="<?php echo get_option('default_pingback_flag') ?>" id="post_pingback" />52 <input type="hidden" name="post_pingback" value="<?php echo (int) get_option('default_pingback_flag') ?>" id="post_pingback" /> 53 53 54 54 <p><label for="trackback"> <?php printf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') ?> … … 65 65 echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' . __('Advanced Editing »') . '" />'; 66 66 } ?> 67 <input name="referredby" type="hidden" id="referredby" value="<?php if ( wp_get_referer() ) echo urlencode(wp_get_referer()); ?>" />67 <input name="referredby" type="hidden" id="referredby" value="<?php if ( $refby = wp_get_referer() ) echo urlencode($refby); ?>" /> 68 68 </p> 69 69 -
branches/2.0/wp-admin/edit-page-form.php
r5675 r5675 10 10 $form_extra = "<input type='hidden' name='temp_ID' value='$temp_ID' />"; 11 11 } else { 12 $post_ID = (int) $post_ID; 12 13 $form_action = 'editpost'; 13 14 $nonce_action = 'update-post_' . $post_ID; 14 15 $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />"; 15 16 } 17 18 $temp_ID = (int) $temp_ID; 19 $user_ID = (int) $user_ID; 16 20 17 21 $sendto = attribute_escape(wp_get_referer()); … … 61 65 <fieldset id="passworddiv" class="dbx-box"> 62 66 <h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3> 63 <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password?>" /></div>67 <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo attribute_escape($post->post_password); ?>" /></div> 64 68 </fieldset> 65 69 … … 86 90 <fieldset id="slugdiv" class="dbx-box"> 87 91 <h3 class="dbx-handle"><?php _e('Post slug') ?></h3> 88 <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name?>" /></div>92 <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape($post->post_name); ?>" /></div> 89 93 </fieldset> 90 94 … … 99 103 if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"'; 100 104 else $selected = ''; 105 $o->ID = (int) $o->ID; 106 $o->display_name = wp_specialchars( $o->display_name ); 101 107 echo "<option value='$o->ID' $selected>$o->display_name</option>"; 102 108 endforeach; … … 119 125 <fieldset id="titlediv"> 120 126 <legend><?php _e('Page Title') ?></legend> 121 <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>127 <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" /></div> 122 128 </fieldset> 123 129 -
branches/2.0/wp-admin/import/dotclear.php
-
Property
svn:eol-style
set to
native
r5675 r5675 1 1 <?php 2 /* 3 * DotClear import plugin 4 * by Thomas Quinot - http://thomas.quinot.org/ 5 */ 6 2 7 /** 3 8 Add These Functions to make our lives easier … … 5 10 if(!function_exists('get_catbynicename')) 6 11 { 7 function get_catbynicename($category_nicename) 12 function get_catbynicename($category_nicename) 8 13 { 9 14 global $wpdb; 10 15 11 16 $cat_id -= 0; // force numeric 12 17 $name = $wpdb->get_var('SELECT cat_ID FROM '.$wpdb->categories.' WHERE category_nicename="'.$category_nicename.'"'); 13 18 14 19 return $name; 15 20 } … … 56 61 // This cries out for a C-implementation to be included in PHP core 57 62 // 58 function valid_1byte($char) { 59 if(!is_int($char)) return false; 60 return ($char & 0x80) == 0x00; 61 } 62 63 function valid_2byte($char) { 64 if(!is_int($char)) return false; 65 return ($char & 0xE0) == 0xC0; 66 } 67 68 function valid_3byte($char) { 69 if(!is_int($char)) return false; 70 return ($char & 0xF0) == 0xE0; 71 } 72 73 function valid_4byte($char) { 74 if(!is_int($char)) return false; 75 return ($char & 0xF8) == 0xF0; 76 } 77 78 function valid_nextbyte($char) { 79 if(!is_int($char)) return false; 80 return ($char & 0xC0) == 0x80; 81 } 82 83 function valid_utf8($string) { 84 $len = strlen($string); 85 $i = 0; 86 while( $i < $len ) { 87 $char = ord(substr($string, $i++, 1)); 88 if(valid_1byte($char)) { // continue 89 continue; 90 } else if(valid_2byte($char)) { // check 1 byte 91 if(!valid_nextbyte(ord(substr($string, $i++, 1)))) 92 return false; 93 } else if(valid_3byte($char)) { // check 2 bytes 94 if(!valid_nextbyte(ord(substr($string, $i++, 1)))) 95 return false; 96 if(!valid_nextbyte(ord(substr($string, $i++, 1)))) 97 return false; 98 } else if(valid_4byte($char)) { // check 3 bytes 99 if(!valid_nextbyte(ord(substr($string, $i++, 1)))) 100 return false; 101 if(!valid_nextbyte(ord(substr($string, $i++, 1)))) 102 return false; 103 if(!valid_nextbyte(ord(substr($string, $i++, 1)))) 104 return false; 105 } // goto next char 106 } 107 return true; // done 108 } 63 64 function valid_1byte($char) { 65 if(!is_int($char)) return false; 66 return ($char & 0x80) == 0x00; 67 } 68 69 function valid_2byte($char) { 70 if(!is_int($char)) return false; 71 return ($char & 0xE0) == 0xC0; 72 } 73 74 function valid_3byte($char) { 75 if(!is_int($char)) return false; 76 return ($char & 0xF0) == 0xE0; 77 } 78 79 function valid_4byte($char) { 80 if(!is_int($char)) return false; 81 return ($char & 0xF8) == 0xF0; 82 } 83 84 function valid_nextbyte($char) { 85 if(!is_int($char)) return false; 86 return ($char & 0xC0) == 0x80; 87 } 88 89 function valid_utf8($string) { 90 $len = strlen($string); 91 $i = 0; 92 while( $i < $len ) { 93 $char = ord(substr($string, $i++, 1)); 94 if(valid_1byte($char)) { // continue 95 continue; 96 } else if(valid_2byte($char)) { // check 1 byte 97 if(!valid_nextbyte(ord(substr($string, $i++, 1)))) 98 return false; 99 } else if(valid_3byte($char)) { // check 2 bytes 100 if(!valid_nextbyte(ord(substr($string, $i++, 1)))) 101 return false; 102 if(!valid_nextbyte(ord(substr($string, $i++, 1)))) 103 return false; 104 } else if(valid_4byte($char)) { // check 3 bytes 105 if(!valid_nextbyte(ord(substr($string, $i++, 1)))) 106 return false; 107 if(!valid_nextbyte(ord(substr($string, $i++, 1)))) 108 return false; 109 if(!valid_nextbyte(ord(substr($string, $i++, 1)))) 110 return false; 111 } // goto next char 112 } 113 return true; // done 114 } 109 115 110 116 function csc ($s) { … … 128 134 { 129 135 echo '<div class="wrap">'; 130 echo '<h2>'.__('Import Dot clear').'</h2>';136 echo '<h2>'.__('Import DotClear').'</h2>'; 131 137 echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'</p>'; 132 138 } … … 136 142 echo '</div>'; 137 143 } 138 144 139 145 function greet() 140 146 { 141 echo '< p>'.__('Howdy! This importer allows you to extract posts from a Dotclear database into your blog. Mileage may vary.').'</p>';142 echo '<p>'.__('Your Dot clear Configuration settings are as follows:').'</p>';147 echo '<div class="narrow"><p>'.__('Howdy! This importer allows you to extract posts from a DotClear database into your blog. Mileage may vary.').'</p>'; 148 echo '<p>'.__('Your DotClear Configuration settings are as follows:').'</p>'; 143 149 echo '<form action="admin.php?import=dotclear&step=1" method="post">'; 150 wp_nonce_field('import-dotclear'); 144 151 $this->db_form(); 145 echo '< input type="submit" name="submit" value="'.__('Import Categories').'" />';146 echo '</form> ';147 } 148 149 function get_dc_cats() 152 echo '<p class="submit"><input type="submit" name="submit" value="'.attribute_escape(__('Import Categories »')).'" /></p>'; 153 echo '</form></div>'; 154 } 155 156 function get_dc_cats() 150 157 { 151 158 global $wpdb; … … 153 160 $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); 154 161 set_magic_quotes_runtime(0); 155 $ prefix = get_option('tpre');156 162 $dbprefix = get_option('dcdbprefix'); 163 157 164 // Get Categories 158 return $dcdb->get_results('SELECT * FROM dc_categorie', ARRAY_A);159 } 160 165 return $dcdb->get_results('SELECT * FROM '.$dbprefix.'categorie', ARRAY_A); 166 } 167 161 168 function get_dc_users() 162 169 { … … 165 172 $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); 166 173 set_magic_quotes_runtime(0); 167 $ prefix = get_option('tpre');168 174 $dbprefix = get_option('dcdbprefix'); 175 169 176 // Get Users 170 171 return $dcdb->get_results('SELECT * FROM dc_user', ARRAY_A);172 } 173 177 178 return $dcdb->get_results('SELECT * FROM '.$dbprefix.'user', ARRAY_A); 179 } 180 174 181 function get_dc_posts() 175 182 { … … 177 184 $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); 178 185 set_magic_quotes_runtime(0); 179 $ prefix = get_option('tpre');180 186 $dbprefix = get_option('dcdbprefix'); 187 181 188 // Get Posts 182 return $dcdb->get_results('SELECT dc_post.*, dc_categorie.cat_libelle_url AS post_cat_name183 FROM dc_post INNER JOIN dc_categorie184 ON dc_post.cat_id = dc_categorie.cat_id', ARRAY_A);185 } 186 189 return $dcdb->get_results('SELECT '.$dbprefix.'post.*, '.$dbprefix.'categorie.cat_libelle_url AS post_cat_name 190 FROM '.$dbprefix.'post INNER JOIN '.$dbprefix.'categorie 191 ON '.$dbprefix.'post.cat_id = '.$dbprefix.'categorie.cat_id', ARRAY_A); 192 } 193 187 194 function get_dc_comments() 188 195 { … … 191 198 $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); 192 199 set_magic_quotes_runtime(0); 193 $ prefix = get_option('tpre');194 200 $dbprefix = get_option('dcdbprefix'); 201 195 202 // Get Comments 196 return $dcdb->get_results('SELECT * FROM dc_comment', ARRAY_A);197 } 198 203 return $dcdb->get_results('SELECT * FROM '.$dbprefix.'comment', ARRAY_A); 204 } 205 199 206 function get_dc_links() 200 207 { … … 202 209 $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); 203 210 set_magic_quotes_runtime(0); 204 $ prefix = get_option('tpre');205 206 return $dcdb->get_results('SELECT * FROM dc_link ORDER BY position', ARRAY_A);207 } 208 209 function cat2wp($categories='') 211 $dbprefix = get_option('dcdbprefix'); 212 213 return $dcdb->get_results('SELECT * FROM '.$dbprefix.'link ORDER BY position', ARRAY_A); 214 } 215 216 function cat2wp($categories='') 210 217 { 211 218 // General Housekeeping … … 217 224 { 218 225 echo '<p>'.__('Importing Categories...').'<br /><br /></p>'; 219 foreach ($categories as $category) 226 foreach ($categories as $category) 220 227 { 221 228 $count++; 222 229 extract($category); 223 230 224 231 // Make Nice Variables 225 232 $name = $wpdb->escape($cat_libelle_url); … … 237 244 $dccat2wpcat[$id] = $ret_id; 238 245 } 239 246 240 247 // Store category translation for future use 241 248 add_option('dccat2wpcat',$dccat2wpcat); … … 246 253 return false; 247 254 } 248 255 249 256 function users2wp($users='') 250 257 { … … 253 260 $count = 0; 254 261 $dcid2wpid = array(); 255 262 256 263 // Midnight Mojo 257 264 if(is_array($users)) … … 262 269 $count++; 263 270 extract($user); 264 271 265 272 // Make Nice Variables 266 273 $name = $wpdb->escape(csc ($name)); 267 274 $RealName = $wpdb->escape(csc ($user_pseudo)); 268 275 269 276 if($uinfo = get_userdatabylogin($name)) 270 277 { 271 278 272 279 $ret_id = wp_insert_user(array( 273 280 'ID' => $uinfo->ID, … … 279 286 ); 280 287 } 281 else 288 else 282 289 { 283 290 $ret_id = wp_insert_user(array( … … 290 297 } 291 298 $dcid2wpid[$user_id] = $ret_id; 292 293 // Set Dot clear-to-WordPress permissions translation294 299 300 // Set DotClear-to-WordPress permissions translation 301 295 302 // Update Usermeta Data 296 303 $user = new WP_User($ret_id); … … 303 310 else if(2 <= $wp_perms) { $user->set_role('contributor'); } 304 311 else { $user->set_role('subscriber'); } 305 312 306 313 update_usermeta( $ret_id, 'wp_user_level', $wp_perms); 307 314 update_usermeta( $ret_id, 'rich_editing', 'false'); … … 309 316 update_usermeta( $ret_id, 'last_name', csc ($user_nom)); 310 317 }// End foreach($users as $user) 311 318 312 319 // Store id translation array for future use 313 320 add_option('dcid2wpid',$dcid2wpid); 314 315 321 322 316 323 echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> users imported.'), $count).'<br /><br /></p>'; 317 324 return true; 318 325 }// End if(is_array($users) 319 326 320 327 echo __('No Users to Import!'); 321 328 return false; 322 329 323 330 }// End function user2wp() 324 331 325 332 function posts2wp($posts='') 326 333 { … … 339 346 $count++; 340 347 extract($post); 341 342 // Set Dot clear-to-WordPress status translation348 349 // Set DotClear-to-WordPress status translation 343 350 $stattrans = array(0 => 'draft', 1 => 'publish'); 344 351 $comment_status_map = array (0 => 'closed', 1 => 'open'); 345 352 346 353 //Can we do this more efficiently? 347 354 $uinfo = ( get_userdatabylogin( $user_id ) ) ? get_userdatabylogin( $user_id ) : 1; … … 350 357 $Title = $wpdb->escape(csc ($post_titre)); 351 358 $post_content = textconv ($post_content); 359 $post_excerpt = ""; 352 360 if ($post_chapo != "") { 353 361 $post_excerpt = textconv ($post_chapo); … … 357 365 $post_content = $wpdb->escape ($post_content); 358 366 $post_status = $stattrans[$post_pub]; 359 367 360 368 // Import Post data into WordPress 361 369 362 370 if($pinfo = post_exists($Title,$post_content)) 363 371 { … … 379 387 ); 380 388 } 381 else 389 else 382 390 { 383 391 $ret_id = wp_insert_post(array( … … 398 406 } 399 407 $dcposts2wpposts[$post_id] = $ret_id; 400 408 401 409 // Make Post-to-Category associations 402 410 $cats = array(); … … 408 416 // Store ID translation for later use 409 417 add_option('dcposts2wpposts',$dcposts2wpposts); 410 418 411 419 echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> posts imported.'), $count).'<br /><br /></p>'; 412 return true; 413 } 414 420 return true; 421 } 422 415 423 function comments2wp($comments='') 416 424 { … … 420 428 $dccm2wpcm = array(); 421 429 $postarr = get_option('dcposts2wpposts'); 422 430 423 431 // Magic Mojo 424 432 if(is_array($comments)) … … 429 437 $count++; 430 438 extract($comment); 431 439 432 440 // WordPressify Data 433 441 $comment_ID = (int) ltrim($comment_id, '0'); … … 438 446 $web = "http://".$wpdb->escape($comment_site); 439 447 $message = $wpdb->escape(textconv ($comment_content)); 440 448 441 449 if($cinfo = comment_exists($name, $comment_dt)) 442 450 { … … 455 463 ); 456 464 } 457 else 465 else 458 466 { 459 467 // Insert comments … … 473 481 } 474 482 // Store Comment ID translation for future use 475 add_option('dccm2wpcm', $dccm2wpcm); 476 483 add_option('dccm2wpcm', $dccm2wpcm); 484 477 485 // Associate newly formed categories with posts 478 486 get_comment_count($ret_id); 479 480 487 488 481 489 echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> comments imported.'), $count).'<br /><br /></p>'; 482 490 return true; … … 485 493 return false; 486 494 } 487 495 488 496 function links2wp($links='') 489 497 { … … 491 499 global $wpdb; 492 500 $count = 0; 493 501 494 502 // Deal with the links 495 503 if(is_array($links)) … … 500 508 $count++; 501 509 extract($link); 502 510 503 511 if ($title != "") { 504 512 if ($cinfo = link_cat_exists (csc ($title))) { … … 512 520 $linkname = $wpdb->escape(csc ($label)); 513 521 $description = $wpdb->escape(csc ($title)); 514 522 515 523 if($linfo = link_exists($linkname)) { 516 524 $ret_id = wp_insert_link(array( … … 541 549 return false; 542 550 } 543 544 function import_categories() 545 { 546 // Category Import 551 552 function import_categories() 553 { 554 // Category Import 547 555 $cats = $this->get_dc_cats(); 548 556 $this->cat2wp($cats); 549 557 add_option('dc_cats', $cats); 550 551 552 558 559 560 553 561 echo '<form action="admin.php?import=dotclear&step=2" method="post">'; 554 printf('<input type="submit" name="submit" value="%s" />', __('Import Users')); 562 wp_nonce_field('import-dotclear'); 563 printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Import Users'))); 555 564 echo '</form>'; 556 565 557 566 } 558 567 559 568 function import_users() 560 569 { 561 570 // User Import 562 $users = $this->get_dc_users(); 571 $users = $this->get_dc_users(); 563 572 $this->users2wp($users); 564 573 565 574 echo '<form action="admin.php?import=dotclear&step=3" method="post">'; 566 printf('<input type="submit" name="submit" value="%s" />', __('Import Posts')); 575 wp_nonce_field('import-dotclear'); 576 printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Import Posts'))); 567 577 echo '</form>'; 568 578 } 569 579 570 580 function import_posts() 571 581 { … … 573 583 $posts = $this->get_dc_posts(); 574 584 $this->posts2wp($posts); 575 585 576 586 echo '<form action="admin.php?import=dotclear&step=4" method="post">'; 577 printf('<input type="submit" name="submit" value="%s" />', __('Import Comments')); 587 wp_nonce_field('import-dotclear'); 588 printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Import Comments'))); 578 589 echo '</form>'; 579 590 } 580 591 581 592 function import_comments() 582 593 { … … 584 595 $comments = $this->get_dc_comments(); 585 596 $this->comments2wp($comments); 586 597 587 598 echo '<form action="admin.php?import=dotclear&step=5" method="post">'; 588 printf('<input type="submit" name="submit" value="%s" />', __('Import Links')); 599 wp_nonce_field('import-dotclear'); 600 printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Import Links'))); 589 601 echo '</form>'; 590 602 } 591 603 592 604 function import_links() 593 605 { … … 596 608 $this->links2wp($links); 597 609 add_option('dc_links', $links); 598 610 599 611 echo '<form action="admin.php?import=dotclear&step=6" method="post">'; 600 printf('<input type="submit" name="submit" value="%s" />', __('Finish')); 612 wp_nonce_field('import-dotclear'); 613 printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Finish'))); 601 614 echo '</form>'; 602 615 } 603 616 604 617 function cleanup_dcimport() 605 618 { 606 delete_option(' tpre');619 delete_option('dcdbprefix'); 607 620 delete_option('dc_cats'); 608 621 delete_option('dcid2wpid'); … … 618 631 $this->tips(); 619 632 } 620 633 621 634 function tips() 622 635 { 623 echo '<p>'.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from Dot clear, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'</p>';636 echo '<p>'.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from DotClear, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'</p>'; 624 637 echo '<h3>'.__('Users').'</h3>'; 625 echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn\'t have that login in Dot clear, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and Dotclear uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Login</a> and change it.'), '/wp-login.php').'</p>';638 echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn\'t have that login in DotClear, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and DotClear uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Login</a> and change it.'), '/wp-login.php').'</p>'; 626 639 echo '<h3>'.__('Preserving Authors').'</h3>'; 627 640 echo '<p>'.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>'; 628 641 echo '<h3>'.__('Textile').'</h3>'; 629 echo '<p>'.__('Also, since you\'re coming from Dot clear, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>. Trust me... You\'ll want it.').'</p>';642 echo '<p>'.__('Also, since you\'re coming from DotClear, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>. Trust me... You\'ll want it.').'</p>'; 630 643 echo '<h3>'.__('WordPress Resources').'</h3>'; 631 644 echo '<p>'.__('Finally, there are numerous WordPress resources around the internet. Some of them are:').'</p>'; … … 637 650 echo '<p>'.sprintf(__('That\'s it! What are you waiting for? Go <a href="%1$s">login</a>!'), '../wp-login.php').'</p>'; 638 651 } 639 652 640 653 function db_form() 641 654 { 642 echo '< ul>';643 printf('< li><label for="dbuser">%s</label> <input type="text" name="dbuser" id="dbuser" /></li>', __('Dotclear Database User:'));644 printf('< li><label for="dbpass">%s</label> <input type="password" name="dbpass" id="dbpass" /></li>', __('Dotclear Database Password:'));645 printf('< li><label for="dbname">%s</label> <input type="text" name="dbname" id="dbname" /></li>', __('Dotclear Database Name:'));646 printf('< li><label for="dbhost">%s</label> <input type="text" name="dbhost" id="dbhost" value="localhost" /></li>', __('Dotclear Database Host:'));647 /* printf('<li><label for="dbprefix">%s</label> <input type="text" name="dbprefix" /></li>', __('Dotclear Table prefix (if any):')); */648 printf('< li><label for="dccharset">%s</label> <input type="text" id="dccharset" name="dccharset" value="ISO-8859-15"/></li>', __('Originating character set:'));649 echo '</ ul>';650 } 651 652 function dispatch() 655 echo '<table class="editform">'; 656 printf('<tr><th><label for="dbuser">%s</label></th><td><input type="text" name="dbuser" id="dbuser" /></td></tr>', __('DotClear Database User:')); 657 printf('<tr><th><label for="dbpass">%s</label></th><td><input type="password" name="dbpass" id="dbpass" /></td></tr>', __('DotClear Database Password:')); 658 printf('<tr><th><label for="dbname">%s</label></th><td><input type="text" name="dbname" id="dbname" /></td></tr>', __('DotClear Database Name:')); 659 printf('<tr><th><label for="dbhost">%s</label></th><td><input type="text" name="dbhost" nameid="dbhost" value="localhost" /></td></tr>', __('DotClear Database Host:')); 660 printf('<tr><th><label for="dbprefix">%s</label></th><td><input type="text" name="dbprefix" id="dbprefix" value="dc_"/></td></tr>', __('DotClear Table prefix:')); 661 printf('<tr><th><label for="dccharset">%s</label></th><td><input type="text" name="dccharset" id="dccharset" value="ISO-8859-15"/></td></tr>', __('Originating character set:')); 662 echo '</table>'; 663 } 664 665 function dispatch() 653 666 { 654 667 … … 658 671 $step = (int) $_GET['step']; 659 672 $this->header(); 660 661 if ( $step > 0 ) 673 674 if ( $step > 0 ) 662 675 { 676 check_admin_referer('import-dotclear'); 677 663 678 if($_POST['dbuser']) 664 679 { 665 680 if(get_option('dcuser')) 666 delete_option('dcuser'); 667 add_option('dcuser', $_POST['dbuser']);681 delete_option('dcuser'); 682 add_option('dcuser', sanitize_user($_POST['dbuser'], true)); 668 683 } 669 684 if($_POST['dbpass']) 670 685 { 671 686 if(get_option('dcpass')) 672 delete_option('dcpass'); 673 add_option('dcpass', $_POST['dbpass']);674 } 675 687 delete_option('dcpass'); 688 add_option('dcpass', sanitize_user($_POST['dbpass'], true)); 689 } 690 676 691 if($_POST['dbname']) 677 692 { 678 693 if(get_option('dcname')) 679 delete_option('dcname'); 680 add_option('dcname', $_POST['dbname']);694 delete_option('dcname'); 695 add_option('dcname', sanitize_user($_POST['dbname'], true)); 681 696 } 682 697 if($_POST['dbhost']) … … 684 699 if(get_option('dchost')) 685 700 delete_option('dchost'); 686 add_option('dchost', $_POST['dbhost']);701 add_option('dchost', sanitize_user($_POST['dbhost'], true)); 687 702 } 688 703 if($_POST['dccharset']) … … 690 705 if(get_option('dccharset')) 691 706 delete_option('dccharset'); 692 add_option('dccharset', $_POST['dccharset']);693 } 707 add_option('dccharset', sanitize_user($_POST['dccharset'], true)); 708 } 694 709 if($_POST['dbprefix']) 695 710 { 696 if(get_option(' tpre'))697 delete_option(' tpre');698 add_option(' tpre',$_POST['dbprefix']);699 } 711 if(get_option('dcdbprefix')) 712 delete_option('dcdbprefix'); 713 add_option('dcdbprefix', sanitize_user($_POST['dbprefix'], true)); 714 } 700 715 701 716 702 717 } 703 718 704 switch ($step) 719 switch ($step) 705 720 { 706 721 default: … … 727 742 break; 728 743 } 729 744 730 745 $this->footer(); 731 746 } 732 747 733 function Dotclear_Import() 734 { 735 // Nothing. 748 function Dotclear_Import() 749 { 750 // Nothing. 736 751 } 737 752 } 738 753 739 754 $dc_import = new Dotclear_Import(); 740 register_importer('dotclear', __('Dot clear'), __('Import posts from a Dotclear Blog'), array ($dc_import, 'dispatch'));755 register_importer('dotclear', __('DotClear'), __('Import categories, users, posts, comments, and links from a DotClear blog'), array ($dc_import, 'dispatch')); 741 756 ?> -
Property
svn:eol-style
set to
-
branches/2.0/wp-admin/import/greymatter.php
r5675 r5675 7 7 function header() { 8 8 echo '<div class="wrap">'; 9 echo '<h2>'.__('Import Grey matter').'</h2>';9 echo '<h2>'.__('Import GreyMatter').'</h2>'; 10 10 } 11 11 … … 35 35 <input type="hidden" name="import" value="greymatter" /> 36 36 <input type="hidden" name="step" value="1" /> 37 <?php wp_nonce_field('import-greymatter'); ?> 37 38 <h3><?php _e('Second step: GreyMatter details:') ?></h3> 38 39 <p><table cellpadding="0"> … … 67 68 return($string); 68 69 } 69 70 70 71 function import() { 71 72 global $wpdb; 72 73 73 74 $wpvarstoreset = array('gmpath', 'archivespath', 'lastentry'); 74 75 for ($i=0; $i<count($wpvarstoreset); $i += 1) { … … 88 89 89 90 if (!chdir($archivespath)) 90 die(sprintf(__("Wrong path, %s\ndoesn't exist\non the server"), $archivespath));91 wp_die(__("Wrong path, the path to the GM entries does not exist on the server")); 91 92 92 93 if (!chdir($gmpath)) 93 die(sprintf(__("Wrong path, %s\ndoesn't exist\non the server"), $gmpath)); 94 94 wp_die(__("Wrong path, the path to the GM files does not exist on the server")); 95 96 $lastentry = (int) $lastentry; 97 95 98 $this->header(); 96 99 ?> … … 129 132 $user_id = wp_insert_user($user_info); 130 133 $this->gmnames[$userdata[0]] = $user_id; 131 134 132 135 printf('<li>'.__('user %s...').' <strong>'.__('Done').'</strong></li>', "<em>$user_login</em>"); 133 136 } … … 137 140 138 141 chdir($archivespath); 139 142 140 143 for($i = 0; $i <= $lastentry; $i = $i + 1) { 141 144 142 145 $entryfile = ""; 143 146 144 147 if ($i<10000000) { 145 148 $entryfile .= "0"; … … 195 198 $comment_status = 'open'; 196 199 $ping_status = 'closed'; 197 200 198 201 if ($post_ID = post_exists($post_title, '', $post_date)) { 199 202 echo ' '; … … 214 217 $user_url=$wpdb->escape(""); 215 218 $user_joindate=$wpdb->escape($user_joindate); 216 219 217 220 $user_info = array("user_login"=>$user_login, "user_pass"=>$pass1, "user_nickname"=>$user_nickname, "user_email"=>$user_email, "user_url"=>$user_url, "user_ip"=>$user_ip, "user_domain"=>$user_domain, "user_browser"=>$user_browser, "dateYMDhour"=>$user_joindate, "user_level"=>0, "user_idmode"=>"nickname"); 218 221 $user_id = wp_insert_user($user_info); 219 222 $this->gmnames[$postinfo[1]] = $user_id; 220 223 221 224 echo ': '; 222 225 printf(__('registered deleted user %s at level 0 '), "<em>$user_login</em>"); 223 226 } 224 227 225 228 if (array_key_exists($postinfo[1], $this->gmnames)) { 226 229 $post_author = $this->gmnames[$postinfo[1]]; … … 228 231 $post_author = $user_id; 229 232 } 230 233 231 234 $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt'); 232 235 $post_ID = wp_insert_post($postdata); … … 282 285 </ul><strong><?php _e('Done') ?></strong></li></ul> 283 286 <p> </p> 284 <p><?php _e('Completed Grey matter import!') ?></p>287 <p><?php _e('Completed GreyMatter import!') ?></p> 285 288 <?php 286 289 $this->footer(); … … 298 301 break; 299 302 case 1: 303 check_admin_referer('import-greymatter'); 300 304 $this->import(); 301 305 break; … … 304 308 305 309 function GM_Import() { 306 // Nothing. 310 // Nothing. 307 311 } 308 312 } … … 310 314 $gm_import = new GM_Import(); 311 315 312 register_importer('greymatter', __('Grey matter'), __('Import posts and comments from yourGreymatter blog'), array ($gm_import, 'dispatch'));316 register_importer('greymatter', __('GreyMatter'), __('Import users, posts, and comments from a Greymatter blog'), array ($gm_import, 'dispatch')); 313 317 ?> -
branches/2.0/wp-admin/import/livejournal.php
r5675 r5675 154 154 break; 155 155 case 1 : 156 check_admin_referer('import-upload'); 156 157 $this->import(); 157 158 break; -
branches/2.0/wp-admin/import/mt.php
r5675 r5675 146 146 echo '<ol id="authors">'; 147 147 echo '<form action="?import=mt&step=2&id=' . $this->id . '" method="post">'; 148 wp_nonce_field('import-mt'); 148 149 $j = -1; 149 150 foreach ($authors as $author) { … … 416 417 break; 417 418 case 1 : 419 check_admin_referer('import-upload'); 418 420 $this->select_authors(); 419 421 break; 420 422 case 2: 423 check_admin_referer('import-mt'); 421 424 $this->import(); 422 425 break; -
branches/2.0/wp-admin/import/rss.php
r5675 r5675 155 155 break; 156 156 case 1 : 157 check_admin_referer('import-upload'); 157 158 $this->import(); 158 159 break; -
branches/2.0/wp-admin/import/textpattern.php
r5675 r5675 5 5 if(!function_exists('get_catbynicename')) 6 6 { 7 function get_catbynicename($category_nicename) 7 function get_catbynicename($category_nicename) 8 8 { 9 9 global $wpdb; 10 10 11 11 $cat_id -= 0; // force numeric 12 12 $name = $wpdb->get_var('SELECT cat_ID FROM '.$wpdb->categories.' WHERE category_nicename="'.$category_nicename.'"'); 13 13 14 14 return $name; 15 15 } … … 50 50 echo '</div>'; 51 51 } 52 53 function greet() 54 { 55 echo '<p>'.__('Howdy! This importer allows you to extract posts from any Textpattern 4.0.2+ into your blog. This has not been tested on previous versions of Textpattern. Mileage may vary.').'</p>'; 52 53 function greet() { 54 echo '<div class="narrow">'; 55 echo '<p>'.__('Howdy! This imports categories, users, posts, comments, and links from any Textpattern 4.0.2+ into this blog.').'</p>'; 56 echo '<p>'.__('This has not been tested on previous versions of Textpattern. Mileage may vary.').'</p>'; 56 57 echo '<p>'.__('Your Textpattern Configuration settings are as follows:').'</p>'; 57 58 echo '<form action="admin.php?import=textpattern&step=1" method="post">'; 59 wp_nonce_field('import-textpattern'); 58 60 $this->db_form(); 59 echo '< input type="submit" name="submit" value="'.__('Import Categories').'" />';61 echo '<p class="submit"><input type="submit" name="submit" value="'.attribute_escape(__('Import Categories »')).'" /></p>'; 60 62 echo '</form>'; 63 echo '</div>'; 61 64 } 62 65 … … 68 71 set_magic_quotes_runtime(0); 69 72 $prefix = get_option('tpre'); 70 73 71 74 // Get Categories 72 return $txpdb->get_results('SELECT 73 74 75 76 FROM '.$prefix.'txp_category77 WHERE type = "article"',78 79 } 80 75 return $txpdb->get_results('SELECT 76 id, 77 name, 78 title 79 FROM '.$prefix.'txp_category 80 WHERE type = "article"', 81 ARRAY_A); 82 } 83 81 84 function get_txp_users() 82 85 { … … 86 89 set_magic_quotes_runtime(0); 87 90 $prefix = get_option('tpre'); 88 91 89 92 // Get Users 90 93 91 94 return $txpdb->get_results('SELECT 92 93 94 95 96 97 98 } 99 95 user_id, 96 name, 97 RealName, 98 email, 99 privs 100 FROM '.$prefix.'txp_users', ARRAY_A); 101 } 102 100 103 function get_txp_posts() 101 104 { … … 104 107 set_magic_quotes_runtime(0); 105 108 $prefix = get_option('tpre'); 106 109 107 110 // Get Posts 108 return $txpdb->get_results('SELECT 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 } 125 111 return $txpdb->get_results('SELECT 112 ID, 113 Posted, 114 AuthorID, 115 LastMod, 116 Title, 117 Body, 118 Excerpt, 119 Category1, 120 Category2, 121 Status, 122 Keywords, 123 url_title, 124 comments_count 125 FROM '.$prefix.'textpattern 126 ', ARRAY_A); 127 } 128 126 129 function get_txp_comments() 127 130 { … … 131 134 set_magic_quotes_runtime(0); 132 135 $prefix = get_option('tpre'); 133 136 134 137 // Get Comments 135 138 return $txpdb->get_results('SELECT * FROM '.$prefix.'txp_discuss', ARRAY_A); 136 139 } 137 140 138 141 function get_txp_links() 139 142 { … … 142 145 set_magic_quotes_runtime(0); 143 146 $prefix = get_option('tpre'); 144 145 return $txpdb->get_results('SELECT 146 147 148 149 150 151 152 FROM '.$prefix.'txp_link',153 ARRAY_A);154 } 155 156 function cat2wp($categories='') 147 148 return $txpdb->get_results('SELECT 149 id, 150 date, 151 category, 152 url, 153 linkname, 154 description 155 FROM '.$prefix.'txp_link', 156 ARRAY_A); 157 } 158 159 function cat2wp($categories='') 157 160 { 158 161 // General Housekeeping … … 164 167 { 165 168 echo '<p>'.__('Importing Categories...').'<br /><br /></p>'; 166 foreach ($categories as $category) 169 foreach ($categories as $category) 167 170 { 168 171 $count++; 169 172 extract($category); 170 171 173 174 172 175 // Make Nice Variables 173 176 $name = $wpdb->escape($name); 174 177 $title = $wpdb->escape($title); 175 178 176 179 if($cinfo = category_exists($name)) 177 180 { … … 184 187 $txpcat2wpcat[$id] = $ret_id; 185 188 } 186 189 187 190 // Store category translation for future use 188 191 add_option('txpcat2wpcat',$txpcat2wpcat); … … 193 196 return false; 194 197 } 195 198 196 199 function users2wp($users='') 197 200 { … … 200 203 $count = 0; 201 204 $txpid2wpid = array(); 202 205 203 206 // Midnight Mojo 204 207 if(is_array($users)) … … 209 212 $count++; 210 213 extract($user); 211 214 212 215 // Make Nice Variables 213 216 $name = $wpdb->escape($name); 214 217 $RealName = $wpdb->escape($RealName); 215 218 216 219 if($uinfo = get_userdatabylogin($name)) 217 220 { 218 221 219 222 $ret_id = wp_insert_user(array( 220 223 'ID' => $uinfo->ID, … … 226 229 ); 227 230 } 228 else 231 else 229 232 { 230 233 $ret_id = wp_insert_user(array( … … 237 240 } 238 241 $txpid2wpid[$user_id] = $ret_id; 239 242 240 243 // Set Textpattern-to-WordPress permissions translation 241 244 $transperms = array(1 => '10', 2 => '9', 3 => '5', 4 => '4', 5 => '3', 6 => '2', 7 => '0'); 242 245 243 246 // Update Usermeta Data 244 247 $user = new WP_User($ret_id); … … 250 253 if('2' == $transperms[$privs]) { $user->set_role('contributor'); } 251 254 if('0' == $transperms[$privs]) { $user->set_role('subscriber'); } 252 255 253 256 update_usermeta( $ret_id, 'wp_user_level', $transperms[$privs] ); 254 257 update_usermeta( $ret_id, 'rich_editing', 'false'); 255 258 }// End foreach($users as $user) 256 259 257 260 // Store id translation array for future use 258 261 add_option('txpid2wpid',$txpid2wpid); 259 260 262 263 261 264 echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> users imported.'), $count).'<br /><br /></p>'; 262 265 return true; 263 266 }// End if(is_array($users) 264 267 265 268 echo __('No Users to Import!'); 266 269 return false; 267 270 268 271 }// End function user2wp() 269 272 270 273 function posts2wp($posts='') 271 274 { … … 284 287 $count++; 285 288 extract($post); 286 289 287 290 // Set Textpattern-to-WordPress status translation 288 291 $stattrans = array(1 => 'draft', 2 => 'private', 3 => 'draft', 4 => 'publish', 5 => 'publish'); 289 292 290 293 //Can we do this more efficiently? 291 294 $uinfo = ( get_userdatabylogin( $AuthorID ) ) ? get_userdatabylogin( $AuthorID ) : 1; … … 296 299 $Excerpt = $wpdb->escape($Excerpt); 297 300 $post_status = $stattrans[$Status]; 298 301 299 302 // Import Post data into WordPress 300 303 301 304 if($pinfo = post_exists($Title,$Body)) 302 305 { 303 306 $ret_id = wp_insert_post(array( 304 305 306 307 308 309 310 311 312 313 314 315 316 317 } 318 else 307 'ID' => $pinfo, 308 'post_date' => $Posted, 309 'post_date_gmt' => $post_date_gmt, 310 'post_author' => $authorid, 311 'post_modified' => $LastMod, 312 'post_modified_gmt' => $post_modified_gmt, 313 'post_title' => $Title, 314 'post_content' => $Body, 315 'post_excerpt' => $Excerpt, 316 'post_status' => $post_status, 317 'post_name' => $url_title, 318 'comment_count' => $comments_count) 319 ); 320 } 321 else 319 322 { 320 323 $ret_id = wp_insert_post(array( 321 322 323 324 325 326 327 328 329 330 331 332 324 'post_date' => $Posted, 325 'post_date_gmt' => $post_date_gmt, 326 'post_author' => $authorid, 327 'post_modified' => $LastMod, 328 'post_modified_gmt' => $post_modified_gmt, 329 'post_title' => $Title, 330 'post_content' => $Body, 331 'post_excerpt' => $Excerpt, 332 'post_status' => $post_status, 333 'post_name' => $url_title, 334 'comment_count' => $comments_count) 335 ); 333 336 } 334 337 $txpposts2wpposts[$ID] = $ret_id; 335 338 336 339 // Make Post-to-Category associations 337 340 $cats = array(); … … 339 342 if($cat2 = get_catbynicename($Category2)) { $cats[2] = $cat2; } 340 343 341 if(!empty($cats)) { wp_set_post_cat s('',$ret_id, $cats); }344 if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); } 342 345 } 343 346 } 344 347 // Store ID translation for later use 345 348 add_option('txpposts2wpposts',$txpposts2wpposts); 346 349 347 350 echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> posts imported.'), $count).'<br /><br /></p>'; 348 return true; 349 } 350 351 return true; 352 } 353 351 354 function comments2wp($comments='') 352 355 { … … 356 359 $txpcm2wpcm = array(); 357 360 $postarr = get_option('txpposts2wpposts'); 358 361 359 362 // Magic Mojo 360 363 if(is_array($comments)) … … 365 368 $count++; 366 369 extract($comment); 367 370 368 371 // WordPressify Data 369 372 $comment_ID = ltrim($discussid, '0'); … … 374 377 $web = $wpdb->escape($web); 375 378 $message = $wpdb->escape($message); 376 379 377 380 if($cinfo = comment_exists($name, $posted)) 378 381 { 379 382 // Update comments 380 383 $ret_id = wp_update_comment(array( 381 382 383 384 385 386 387 388 389 390 } 391 else 384 'comment_ID' => $cinfo, 385 'comment_post_ID' => $comment_post_ID, 386 'comment_author' => $name, 387 'comment_author_email' => $email, 388 'comment_author_url' => $web, 389 'comment_date' => $posted, 390 'comment_content' => $message, 391 'comment_approved' => $comment_approved) 392 ); 393 } 394 else 392 395 { 393 396 // Insert comments 394 397 $ret_id = wp_insert_comment(array( 395 396 397 398 399 400 401 402 403 398 'comment_post_ID' => $comment_post_ID, 399 'comment_author' => $name, 400 'comment_author_email' => $email, 401 'comment_author_url' => $web, 402 'comment_author_IP' => $ip, 403 'comment_date' => $posted, 404 'comment_content' => $message, 405 'comment_approved' => $comment_approved) 406 ); 404 407 } 405 408 $txpcm2wpcm[$comment_ID] = $ret_id; 406 409 } 407 410 // Store Comment ID translation for future use 408 add_option('txpcm2wpcm', $txpcm2wpcm); 409 411 add_option('txpcm2wpcm', $txpcm2wpcm); 412 410 413 // Associate newly formed categories with posts 411 414 get_comment_count($ret_id); 412 413 415 416 414 417 echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> comments imported.'), $count).'<br /><br /></p>'; 415 418 return true; … … 418 421 return false; 419 422 } 420 423 421 424 function links2wp($links='') 422 425 { … … 424 427 global $wpdb; 425 428 $count = 0; 426 429 427 430 // Deal with the links 428 431 if(is_array($links)) … … 433 436 $count++; 434 437 extract($link); 435 438 436 439 // Make nice vars 437 440 $category = $wpdb->escape($category); 438 441 $linkname = $wpdb->escape($linkname); 439 442 $description = $wpdb->escape($description); 440 443 441 444 if($linfo = link_exists($linkname)) 442 445 { … … 450 453 ); 451 454 } 452 else 455 else 453 456 { 454 457 $ret_id = wp_insert_link(array( … … 471 474 return false; 472 475 } 473 474 function import_categories() 475 { 476 // Category Import 476 477 function import_categories() 478 { 479 // Category Import 477 480 $cats = $this->get_txp_cats(); 478 481 $this->cat2wp($cats); 479 482 add_option('txp_cats', $cats); 480 481 482 483 484 485 483 486 echo '<form action="admin.php?import=textpattern&step=2" method="post">'; 484 printf('<input type="submit" name="submit" value="%s" />', __('Import Users')); 487 wp_nonce_field('import-textpattern'); 488 printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Import Users'))); 485 489 echo '</form>'; 486 490 487 491 } 488 492 489 493 function import_users() 490 494 { 491 495 // User Import 492 $users = $this->get_txp_users(); 496 $users = $this->get_txp_users(); 493 497 $this->users2wp($users); 494 498 495 499 echo '<form action="admin.php?import=textpattern&step=3" method="post">'; 496 printf('<input type="submit" name="submit" value="%s" />', __('Import Posts')); 500 wp_nonce_field('import-textpattern'); 501 printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Import Posts'))); 497 502 echo '</form>'; 498 503 } 499 504 500 505 function import_posts() 501 506 { … … 503 508 $posts = $this->get_txp_posts(); 504 509 $this->posts2wp($posts); 505 510 506 511 echo '<form action="admin.php?import=textpattern&step=4" method="post">'; 507 printf('<input type="submit" name="submit" value="%s" />', __('Import Comments')); 512 wp_nonce_field('import-textpattern'); 513 printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Import Comments'))); 508 514 echo '</form>'; 509 515 } 510 516 511 517 function import_comments() 512 518 { … … 514 520 $comments = $this->get_txp_comments(); 515 521 $this->comments2wp($comments); 516 522 517 523 echo '<form action="admin.php?import=textpattern&step=5" method="post">'; 518 printf('<input type="submit" name="submit" value="%s" />', __('Import Links')); 524 wp_nonce_field('import-textpattern'); 525 printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Import Links'))); 519 526 echo '</form>'; 520 527 } 521 528 522 529 function import_links() 523 530 { … … 526 533 $this->links2wp($links); 527 534 add_option('txp_links', $links); 528 535 529 536 echo '<form action="admin.php?import=textpattern&step=6" method="post">'; 530 printf('<input type="submit" name="submit" value="%s" />', __('Finish')); 537 wp_nonce_field('import-textpattern'); 538 printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Finish'))); 531 539 echo '</form>'; 532 540 } 533 541 534 542 function cleanup_txpimport() 535 543 { … … 547 555 $this->tips(); 548 556 } 549 557 550 558 function tips() 551 559 { … … 566 574 echo '<p>'.sprintf(__('That\'s it! What are you waiting for? Go <a href="%1$s">login</a>!'), '/wp-login.php').'</p>'; 567 575 } 568 576 569 577 function db_form() 570 578 { 571 echo '< ul>';572 printf('< li><label for="dbuser">%s</label> <input type="text" name="dbuser" id="dbuser" /></li>', __('Textpattern Database User:'));573 printf('< li><label for="dbpass">%s</label> <input type="password" name="dbpass" id="dbpass" /></li>', __('Textpattern Database Password:'));574 printf('< li><label for="dbname">%s</label> <input type="text" id="dbname" name="dbname" /></li>', __('Textpattern Database Name:'));575 printf('< li><label for="dbhost">%s</label> <input type="text" id="dbhost" name="dbhost" value="localhost" /></li>', __('Textpattern Database Host:'));576 printf('< li><label for="dbprefix">%s</label> <input type="text" name="dbprefix" id="dbprefix" /></li>', __('Textpattern Table prefix (if any):'));577 echo '</ ul>';578 } 579 580 function dispatch() 579 echo '<table class="editform">'; 580 printf('<tr><th scope="row"><label for="dbuser">%s</label></th><td><input type="text" name="dbuser" id="dbuser" /></td></tr>', __('Textpattern Database User:')); 581 printf('<tr><th scope="row"><label for="dbpass">%s</label></th><td><input type="password" name="dbpass" id="dbpass" /></td></tr>', __('Textpattern Database Password:')); 582 printf('<tr><th scope="row"><label for="dbname">%s</label></th><td><input type="text" id="dbname" name="dbname" /></td></tr>', __('Textpattern Database Name:')); 583 printf('<tr><th scope="row"><label for="dbhost">%s</label></th><td><input type="text" id="dbhost" name="dbhost" value="localhost" /></td></tr>', __('Textpattern Database Host:')); 584 printf('<tr><th scope="row"><label for="dbprefix">%s</label></th><td><input type="text" name="dbprefix" id="dbprefix" /></td></tr>', __('Textpattern Table prefix (if any):')); 585 echo '</table>'; 586 } 587 588 function dispatch() 581 589 { 582 590 … … 586 594 $step = (int) $_GET['step']; 587 595 $this->header(); 588 589 if ( $step > 0 ) 596 597 if ( $step > 0 ) 590 598 { 599 check_admin_referer('import-textpattern'); 600 591 601 if($_POST['dbuser']) 592 602 { 593 603 if(get_option('txpuser')) 594 delete_option('txpuser'); 595 add_option('txpuser', $_POST['dbuser']);604 delete_option('txpuser'); 605 add_option('txpuser', sanitize_user($_POST['dbuser'], true)); 596 606 } 597 607 if($_POST['dbpass']) 598 608 { 599 609 if(get_option('txppass')) 600 delete_option('txppass'); 601 add_option('txppass', $_POST['dbpass']);602 } 603 610 delete_option('txppass'); 611 add_option('txppass', sanitize_user($_POST['dbpass'], true)); 612 } 613 604 614 if($_POST['dbname']) 605 615 { 606 616 if(get_option('txpname')) 607 delete_option('txpname'); 608 add_option('txpname', $_POST['dbname']);617 delete_option('txpname'); 618 add_option('txpname', sanitize_user($_POST['dbname'], true)); 609 619 } 610 620 if($_POST['dbhost']) … … 612 622 if(get_option('txphost')) 613 623 delete_option('txphost'); 614 add_option('txphost', $_POST['dbhost']);624 add_option('txphost', sanitize_user($_POST['dbhost'], true)); 615 625 } 616 626 if($_POST['dbprefix']) … … 618 628 if(get_option('tpre')) 619 629 delete_option('tpre'); 620 add_option('tpre', $_POST['dbprefix']);621 } 630 add_option('tpre', sanitize_user($_POST['dbprefix'])); 631 } 622 632 623 633 624 634 } 625 635 626 switch ($step) 636 switch ($step) 627 637 { 628 638 default: … … 649 659 break; 650 660 } 651 661 652 662 $this->footer(); 653 663 } 654 664 655 function Textpattern_Import() 656 { 657 // Nothing. 665 function Textpattern_Import() 666 { 667 // Nothing. 658 668 } 659 669 } 660 670 661 671 $txp_import = new Textpattern_Import(); 662 register_importer('textpattern', __('Textpattern'), __('Import posts from a Textpattern Blog'), array ($txp_import, 'dispatch'));672 register_importer('textpattern', __('Textpattern'), __('Import categories, users, posts, comments, and links from a Textpattern blog'), array ($txp_import, 'dispatch')); 663 673 ?> -
branches/2.0/wp-admin/post.php
r5675 r5675 195 195 $p = (int) $_GET['p']; 196 196 197 if ( ! $comment = get_comment ($comment) )197 if ( ! $comment = get_comment_to_edit($comment) ) 198 198 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 199 199 -
branches/2.0/wp-content/themes/default/attachment.php
-
Property
svn:eol-style
set to
native
-
Property
svn:eol-style
set to
-
branches/2.0/wp-content/themes/default/functions.php
-
Property
svn:eol-style
set to
native
r5675 r5675 22 22 23 23 function kubrick_header_image() { 24 return apply_filters('kubrick_header_image', get_ settings('kubrick_header_image'));24 return apply_filters('kubrick_header_image', get_option('kubrick_header_image')); 25 25 } 26 26 27 27 function kubrick_upper_color() { 28 if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' )) {28 if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { 29 29 parse_str(substr($url, strpos($url, '?') + 1), $q); 30 30 return $q['upper']; … … 34 34 35 35 function kubrick_lower_color() { 36 if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' )) {36 if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { 37 37 parse_str(substr($url, strpos($url, '?') + 1), $q); 38 38 return $q['lower']; … … 51 51 52 52 function kubrick_header_color() { 53 return apply_filters('kubrick_header_color', get_ settings('kubrick_header_color'));53 return apply_filters('kubrick_header_color', get_option('kubrick_header_color')); 54 54 } 55 55 … … 63 63 64 64 function kubrick_header_display() { 65 return apply_filters('kubrick_header_display', get_ settings('kubrick_header_display'));65 return apply_filters('kubrick_header_display', get_option('kubrick_header_display')); 66 66 } 67 67 … … 76 76 if ( $_GET['page'] == basename(__FILE__) ) { 77 77 if ( 'save' == $_REQUEST['action'] ) { 78 check_admin_referer('kubrick-header'); 78 79 if ( isset($_REQUEST['njform']) ) { 79 80 if ( isset($_REQUEST['defaults']) ) { … … 84 85 if ( '' == $_REQUEST['njfontcolor'] ) 85 86 delete_option('kubrick_header_color'); 86 else 87 update_option('kubrick_header_color', $_REQUEST['njfontcolor']); 88 87 else { 88 $fontcolor = preg_replace('/^.*(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['njfontcolor']); 89 update_option('kubrick_header_color', $fontcolor); 90 } 89 91 if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) { 90 92 $uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0]; … … 94 96 95 97 if ( isset($_REQUEST['toggledisplay']) ) { 96 if ( false === get_ settings('kubrick_header_display') )98 if ( false === get_option('kubrick_header_display') ) 97 99 update_option('kubrick_header_display', 'none'); 98 100 else … … 103 105 104 106 if ( isset($_REQUEST['headerimage']) ) { 107 check_admin_referer('kubrick-header'); 105 108 if ( '' == $_REQUEST['headerimage'] ) 106 109 delete_option('kubrick_header_image'); 107 else 108 update_option('kubrick_header_image', $_REQUEST['headerimage']); 110 else { 111 $headerimage = preg_replace('/^.*?(header-img.php\?upper=[0-9a-fA-F]{6}&lower=[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['headerimage']); 112 update_option('kubrick_header_image', $headerimage); 113 } 109 114 } 110 115 111 116 if ( isset($_REQUEST['fontcolor']) ) { 117 check_admin_referer('kubrick-header'); 112 118 if ( '' == $_REQUEST['fontcolor'] ) 113 119 delete_option('kubrick_header_color'); 114 else 115 update_option('kubrick_header_color', $_REQUEST['fontcolor']); 120 else { 121 $fontcolor = preg_replace('/^.*?(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['fontcolor']); 122 update_option('kubrick_header_color', $fontcolor); 123 } 116 124 } 117 125 118 126 if ( isset($_REQUEST['fontdisplay']) ) { 127 check_admin_referer('kubrick-header'); 119 128 if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] ) 120 129 delete_option('kubrick_header_display'); … … 227 236 } 228 237 function kRevert() { 229 document.getElementById('headerimage').value = '<?php echo kubrick_header_image(); ?>';230 document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#<?php echo kubrick_upper_color(); ?>';231 document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#<?php echo kubrick_lower_color(); ?>';232 document.getElementById('header').style.background = 'url("<?php echo kubrick_header_image_url(); ?>") center no-repeat';238 document.getElementById('headerimage').value = '<?php echo js_escape(kubrick_header_image()); ?>'; 239 document.getElementById('advuppercolor').value = document.getElementById('uppercolor').value = '#<?php echo js_escape(kubrick_upper_color()); ?>'; 240 document.getElementById('advlowercolor').value = document.getElementById('lowercolor').value = '#<?php echo js_escape(kubrick_lower_color()); ?>'; 241 document.getElementById('header').style.background = 'url("<?php echo js_escape(kubrick_header_image_url()); ?>") center no-repeat'; 233 242 document.getElementById('header').style.color = ''; 234 document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '<?php echo kubrick_header_color_string(); ?>';235 document.getElementById('fontdisplay').value = '<?php echo kubrick_header_display_string(); ?>';243 document.getElementById('advfontcolor').value = document.getElementById('fontcolor').value = '<?php echo js_escape(kubrick_header_color_string()); ?>'; 244 document.getElementById('fontdisplay').value = '<?php echo js_escape(kubrick_header_display_string()); ?>'; 236 245 document.getElementById('headerimg').style.display = document.getElementById('fontdisplay').value; 237 246 } … … 355 364 <div id="nonJsForm"> 356 365 <form method="post" action=""> 366 <?php wp_nonce_field('kubrick-header'); ?> 357 367 <div class="zerosize"><input type="submit" name="defaultsubmit" value="Save" /></div> 358 <label for="njfontcolor">Font Color:</label><input type="text" name="njfontcolor" id="njfontcolor" value="<?php echo kubrick_header_color(); ?>" /> Any CSS color (<code>red</code> or <code>#FF0000</code> or <code>rgb(255, 0, 0)</code>)<br />359 <label for="njuppercolor">Upper Color:</label><input type="text" name="njuppercolor" id="njuppercolor" value="#<?php echo kubrick_upper_color(); ?>" /> HEX only (<code>#FF0000</code> or <code>#F00</code>)<br />360 <label for="njlowercolor">Lower Color:</label><input type="text" name="njlowercolor" id="njlowercolor" value="#<?php echo kubrick_lower_color(); ?>" /> HEX only (<code>#FF0000</code> or <code>#F00</code>)<br />361 <input type="hidden" name="hi" id="hi" value="<?php echo kubrick_header_image(); ?>" />368 <label for="njfontcolor">Font Color:</label><input type="text" name="njfontcolor" id="njfontcolor" value="<?php echo attribute_escape(kubrick_header_color()); ?>" /> Any CSS color (<code>red</code> or <code>#FF0000</code> or <code>rgb(255, 0, 0)</code>)<br /> 369 <label for="njuppercolor">Upper Color:</label><input type="text" name="njuppercolor" id="njuppercolor" value="#<?php echo attribute_escape(kubrick_upper_color()); ?>" /> HEX only (<code>#FF0000</code> or <code>#F00</code>)<br /> 370 <label for="njlowercolor">Lower Color:</label><input type="text" name="njlowercolor" id="njlowercolor" value="#<?php echo attribute_escape(kubrick_lower_color()); ?>" /> HEX only (<code>#FF0000</code> or <code>#F00</code>)<br /> 371 <input type="hidden" name="hi" id="hi" value="<?php echo attribute_escape(kubrick_header_image()); ?>" /> 362 372 <input type="submit" name="toggledisplay" id="toggledisplay" value="Toggle Text" /> 363 373 <input type="submit" name="defaults" value="Use Defaults" /> … … 369 379 <div id="jsForm"> 370 380 <form style="display:inline;" method="post" name="hicolor" id="hicolor" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> 381 <?php wp_nonce_field('kubrick-header'); ?> 371 382 <input type="button" onclick="tgt=document.getElementById('fontcolor');colorSelect(tgt,'pick1');return false;" name="pick1" id="pick1" value="Font Color"></input> 372 383 <input type="button" onclick="tgt=document.getElementById('uppercolor');colorSelect(tgt,'pick2');return false;" name="pick2" id="pick2" value="Upper Color"></input> … … 374 385 <input type="button" name="revert" value="Revert" onclick="kRevert()" /> 375 386 <input type="button" value="Advanced" onclick="toggleAdvanced()" /> 376 <input type="submit" name="submitform" class="defbutton" value="Save" onclick="cp.hidePopup('prettyplease')" />377 387 <input type="hidden" name="action" value="save" /> 378 <input type="hidden" name="fontdisplay" id="fontdisplay" value="<?php echo kubrick_header_display(); ?>" /> 379 <input type="hidden" name="fontcolor" id="fontcolor" value="<?php echo kubrick_header_color(); ?>" /> 380 <input type="hidden" name="uppercolor" id="uppercolor" value="<?php echo kubrick_upper_color(); ?>" /> 381 <input type="hidden" name="lowercolor" id="lowercolor" value="<?php echo kubrick_lower_color(); ?>" /> 382 <input type="hidden" name="headerimage" id="headerimage" value="<?php echo kubrick_header_image(); ?>" /> 388 <input type="hidden" name="fontdisplay" id="fontdisplay" value="<?php echo attribute_escape(kubrick_header_display()); ?>" /> 389 <input type="hidden" name="fontcolor" id="fontcolor" value="<?php echo attribute_escape(kubrick_header_color()); ?>" /> 390 <input type="hidden" name="uppercolor" id="uppercolor" value="<?php echo attribute_escape(kubrick_upper_color()); ?>" /> 391 <input type="hidden" name="lowercolor" id="lowercolor" value="<?php echo attribute_escape(kubrick_lower_color()); ?>" /> 392 <input type="hidden" name="headerimage" id="headerimage" value="<?php echo attribute_escape(kubrick_header_image()); ?>" /> 393 <p class="submit"><input type="submit" name="submitform" class="defbutton" value="<?php _e('Update Header »'); ?>" onclick="cp.hidePopup('prettyplease')" /></p> 383 394 </form> 384 395 <div id="colorPickerDiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;visibility:hidden;"> </div> 385 396 <div id="advanced"> 386 397 <form id="jsAdvanced" style="display:none;" action=""> 387 <label for="advfontcolor">Font Color (CSS): </label><input type="text" id="advfontcolor" onchange="advUpdate(this.value, 'fontcolor')" value="<?php echo kubrick_header_color(); ?>" /><br /> 388 <label for="advuppercolor">Upper Color (HEX): </label><input type="text" id="advuppercolor" onchange="advUpdate(this.value, 'uppercolor')" value="#<?php echo kubrick_upper_color(); ?>" /><br /> 389 <label for="advlowercolor">Lower Color (HEX): </label><input type="text" id="advlowercolor" onchange="advUpdate(this.value, 'lowercolor')" value="#<?php echo kubrick_lower_color(); ?>" /><br /> 398 <?php wp_nonce_field('kubrick-header'); ?> 399 <label for="advfontcolor">Font Color (CSS): </label><input type="text" id="advfontcolor" onchange="advUpdate(this.value, 'fontcolor')" value="<?php echo attribute_escape(kubrick_header_color()); ?>" /><br /> 400 <label for="advuppercolor">Upper Color (HEX): </label><input type="text" id="advuppercolor" onchange="advUpdate(this.value, 'uppercolor')" value="#<?php echo attribute_escape(kubrick_upper_color()); ?>" /><br /> 401 <label for="advlowercolor">Lower Color (HEX): </label><input type="text" id="advlowercolor" onchange="advUpdate(this.value, 'lowercolor')" value="#<?php echo attribute_escape(kubrick_lower_color()); ?>" /><br /> 390 402 <input type="button" name="default" value="Select Default Colors" onclick="kDefaults()" /><br /> 391 403 <input type="button" onclick="toggleDisplay();return false;" name="pick" id="pick" value="Toggle Text Display"></input><br /> -
Property
svn:eol-style
set to
-
branches/2.0/wp-includes/pluggable-functions.php
r5675 r5675 120 120 if ( $userdata ) 121 121 return $userdata; 122 123 $user_login = $wpdb->escape($user_login); 122 124 123 125 if ( !$user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_login = '$user_login'") ) -
branches/2.0/wp-includes/version.php
r5675 r5675 3 3 // This just holds the version number, in a separate file so we can bump it without cluttering the SVN 4 4 5 $wp_version = '2.0.1 0';5 $wp_version = '2.0.11-RC2'; 6 6 $wp_db_version = 3441; 7 7 -
branches/2.0/wp-links-opml.php
r5675 r5675 29 29 <?php $sql = "SELECT $wpdb->links.link_url, link_rss, $wpdb->links.link_name, $wpdb->links.link_category, $wpdb->linkcategories.cat_name, link_updated 30 30 FROM $wpdb->links 31 JOIN $wpdb->linkcategories on $wpdb->links.link_category = $wpdb->linkcategories.cat_id31 INNER JOIN $wpdb->linkcategories on $wpdb->links.link_category = $wpdb->linkcategories.cat_id 32 32 AND $wpdb->links.link_visible = 'Y' 33 33 $sql_cat -
branches/2.0/wp-mail.php
r5675 r5675 59 59 // Set the author using the email address (To or Reply-To, the last used) 60 60 // otherwise use the site admin 61 if (preg_match('/From: /', $line) | preg_match(' Reply-To: /', $line)) {61 if (preg_match('/From: /', $line) | preg_match('/Reply-To: /', $line)) { 62 62 $author=trim($line); 63 63 if ( ereg("([a-zA-Z0-9\_\-\.]+@[\a-zA-z0-9\_\-\.]+)", $author , $regs) ) {
Note: See TracChangeset
for help on using the changeset viewer.