Changeset 3029
- Timestamp:
- 11/10/2005 11:25:39 PM (19 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r3000 r3029 976 976 } 977 977 978 function got_mod_rewrite() { 979 global $is_apache; 980 981 // take 3 educated guesses as to whether or not mod_rewrite is available 982 if ( !$is_apache ) 983 return false; 984 985 if ( function_exists('apache_get_modules') ) { 986 if ( !in_array('mod_rewrite', apache_get_modules()) ) 987 return false; 988 } 989 990 if ( function_exists('ob_get_clean') ) { 991 ob_start(); 992 phpinfo(INFO_MODULES); 993 $php_modules = ob_get_clean(); 994 if ( strpos($php_modules, 'mod_rewrite') === false) 995 return false; 996 } 997 998 return true; 999 } 1000 978 1001 function save_mod_rewrite_rules() { 979 1002 global $is_apache, $wp_rewrite; … … 986 1009 return; 987 1010 988 if (! $is_apache)1011 if (! got_mod_rewrite()) 989 1012 return; 990 1013 -
trunk/wp-admin/options-permalink.php
r2762 r3029 104 104 <?php 105 105 $prefix = ''; 106 if ( !$is_apache ) 106 107 if ( ! got_mod_rewrite() ) 107 108 $prefix = '/index.php'; 109 110 $structures = array( 111 '', 112 $prefix . '/%year%/%monthnum%/%day%/%postname%/', 113 $prefix . '/archives/%post_id%' 114 ); 108 115 ?> 109 116 <form name="form" action="options-permalink.php" method="post"> … … 111 118 <p> 112 119 <label> 113 <input name="selection" type="radio" value=" <?php echo $prefix; ?>/%year%/%monthnum%/%day%/%postname%/" class="tog" <?php checked( $prefix . '/%year%/%monthnum%/%day%/%postname%/', $permalink_structure); ?> />114 <?php _e('D ate and name based, example:'); ?> <code><?php echo get_settings('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code>120 <input name="selection" type="radio" value="" class="tog" <?php checked('', $permalink_structure); ?> /> 121 <?php _e('Default'); ?><br /> <span> » <code><?php echo get_settings('home'); ?>/?p=123</code></span> 115 122 </label> 116 123 </p> 117 124 <p> 118 125 <label> 119 <input name="selection" type="radio" value="<?php echo $prefix; ?>/archives/%post_id%" class="tog" <?php checked( $prefix . '/archives/%post_id%', $permalink_structure); ?> /> 120 <?php _e('Numeric, example:'); ?> <code><?php echo get_settings('home') . $prefix ; ?>/archives/123</code> 126 <input name="selection" type="radio" value="<?php echo $structures[1]; ?>" class="tog" <?php checked($structures[1], $permalink_structure); ?> /> 127 <?php _e('Date and name based'); ?><br /> <span> » <code><?php echo get_settings('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></span> 128 </label> 129 </p> 130 <p> 131 <label> 132 <input name="selection" type="radio" value="<?php echo $structures[2]; ?>" class="tog" <?php checked($structures[2], $permalink_structure); ?> /> 133 <?php _e('Numeric'); ?><br /> <span> » <code><?php echo get_settings('home') . $prefix ; ?>/archives/123</code></span> 121 134 </label> 122 135 </p> … … 124 137 <label> 125 138 <input name="selection" type="radio" value="custom" class="tog" 126 <?php if ( $permalink_structure != $prefix . '/archives/%post_id%' && $permalink_structure != $prefix . '/%year%/%monthnum%/%day%/%postname%/') { ?>139 <?php if ( !in_array($permalink_structure, $structures) ) { ?> 127 140 checked="checked" 128 141 <?php } ?>
Note: See TracChangeset
for help on using the changeset viewer.