Changeset 11350 for trunk/wp-admin/options-permalink.php
- Timestamp:
- 05/16/2009 02:04:36 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/options-permalink.php
r11204 r11350 71 71 72 72 $home_path = get_home_path(); 73 $iis7_permalinks = iis7_supports_permalinks(); 73 74 74 75 if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) { … … 101 102 $tag_base = get_option( 'tag_base' ); 102 103 103 if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') ) 104 $writable = true; 105 else 106 $writable = false; 107 108 if ($wp_rewrite->using_index_permalinks()) 104 if ( $iis7_permalinks ) { 105 if ( ( ! file_exists($home_path . 'web.config') && win_is_writable($home_path) ) || win_is_writable($home_path . 'web.config') ) 106 $writable = true; 107 else 108 $writable = false; 109 } else { 110 if ( ( ! file_exists($home_path . '.htaccess') && is_writable($home_path) ) || is_writable($home_path . '.htaccess') ) 111 $writable = true; 112 else 113 $writable = false; 114 } 115 116 if ( $wp_rewrite->using_index_permalinks() ) 109 117 $usingpi = true; 110 118 else … … 116 124 <?php if (isset($_POST['submit'])) : ?> 117 125 <div id="message" class="updated fade"><p><?php 118 if ( $permalink_structure && !$usingpi && !$writable ) 119 _e('You should update your .htaccess now.'); 120 else 121 _e('Permalink structure updated.'); 122 ?></p></div> 126 if ( $iis7_permalinks ) { 127 if ( $permalink_structure && ! $usingpi && ! $writable ) 128 _e('You should update your web.config now'); 129 else if ( $permalink_structure && ! $usingpi && $writable) 130 _e('Permalink structure updated. Remove write access on web.config file now!'); 131 else 132 _e('Permalink structure updated'); 133 } else { 134 if ( $permalink_structure && ! $usingpi && ! $writable ) 135 _e('You should update your .htaccess now.'); 136 else 137 _e('Permalink structure updated.'); 138 } 139 ?> 140 </p></div> 123 141 <?php endif; ?> 124 142 … … 135 153 $prefix = ''; 136 154 137 if ( ! got_mod_rewrite() )155 if ( ! got_mod_rewrite() && ! $iis7_permalinks ) 138 156 $prefix = '/index.php'; 139 157 … … 180 198 181 199 <h3><?php _e('Optional'); ?></h3> 182 <?php if ( $is_apache) : ?>200 <?php if ( $is_apache || $iis7_permalinks ) : ?> 183 201 <p><?php _e('If you like, you may enter custom structures for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <kbd>topics</kbd> as your category base would make your category links like <code>http://example.org/topics/uncategorized/</code>. If you leave these blank the defaults will be used.') ?></p> 184 202 <?php else : ?> … … 204 222 </p> 205 223 </form> 206 <?php if ( $permalink_structure && !$usingpi && !$writable ) : ?> 207 <p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p> 224 <?php if ($iis7_permalinks) : 225 if ( isset($_POST['submit']) && $permalink_structure && ! $usingpi && ! $writable ) : ?> 226 <p><?php _e('If your <code>web.config</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so this is the url rewrite rule you should have in your <code>web.config</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this rule inside of the <code>/<configuration>/<system.webServer>/<rewrite>/<rules></code> element in <code>web.config</code> file.') ?></p> 227 <form action="options-permalink.php" method="post"> 228 <?php wp_nonce_field('update-permalink') ?> 229 <p><textarea rows="10" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo wp_specialchars($wp_rewrite->iis7_url_rewrite_rules()); ?></textarea></p> 230 </form> 231 <p><?php _e('If you temporarily make your <code>web.config</code> file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.') ?></p> 232 <?php endif; ?> 233 <?php else : 234 if ( $permalink_structure && ! $usingpi && ! $writable ) : ?> 235 <p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p> 208 236 <form action="options-permalink.php" method="post"> 209 237 <?php wp_nonce_field('update-permalink') ?> 210 238 <p><textarea rows="6" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo wp_specialchars($wp_rewrite->mod_rewrite_rules()); ?></textarea></p> 211 239 </form> 240 <?php endif; ?> 212 241 <?php endif; ?> 213 242
Note: See TracChangeset
for help on using the changeset viewer.