Changeset 1972
- Timestamp:
- 12/18/04 00:28:24 (4 years ago)
- Files:
-
- trunk/wp-blog-header.php (modified) (2 diffs)
- trunk/wp-includes/classes.php (modified) (6 diffs)
- trunk/wp-includes/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-blog-header.php
r1923 r1972 108 108 } 109 109 110 if ( 1 == $tb) {110 if (is_trackback()) { 111 111 $doing_trackback = true; 112 112 } … … 211 211 do_action('template_redirect', ''); 212 212 if (is_feed()) { 213 $wp_did_template_redirect = true;214 213 include(dirname(__FILE__) . '/wp-feed.php'); 215 214 exit; 216 } else if ($tb == 1) { 217 $wp_did_template_redirect = true; 215 } else if (is_trackback()) { 218 216 include(dirname(__FILE__) . '/wp-trackback.php'); 219 217 exit; 220 218 } else if (is_404() && 221 219 file_exists("$wp_template_dir/404.php")) { 222 $wp_did_template_redirect = true;223 220 include("$wp_template_dir/404.php"); 224 221 exit; 225 222 } else if (is_home() && 226 223 file_exists("$wp_template_dir/index.php")) { 227 $wp_did_template_redirect = true;228 224 include("$wp_template_dir/index.php"); 229 225 exit; 230 226 } else if (is_single() && 231 227 file_exists("$wp_template_dir/single.php")) { 232 $wp_did_template_redirect = true;233 228 include("$wp_template_dir/single.php"); 234 229 exit; 235 230 } else if (is_page() && file_exists(get_page_template())) { 236 $wp_did_template_redirect = true;237 231 include(get_page_template()); 238 232 exit; 239 233 } else if (is_category() && 240 234 file_exists("$wp_template_dir/category.php")) { 241 $wp_did_template_redirect = true;242 235 include("$wp_template_dir/category.php"); 243 236 exit; 244 237 } else if (is_author() && 245 238 file_exists("$wp_template_dir/author.php")) { 246 $wp_did_template_redirect = true;247 239 include("$wp_template_dir/author.php"); 248 240 exit; 249 241 } else if (is_date() && 250 242 file_exists("$wp_template_dir/date.php")) { 251 $wp_did_date = true;252 $wp_did_template_redirect = true;253 243 include("$wp_template_dir/date.php"); 254 244 exit; 255 245 } else if (is_archive() && 256 246 file_exists("$wp_template_dir/archive.php")) { 257 $wp_did_template_redirect = true;258 247 include("$wp_template_dir/archive.php"); 259 248 exit; 260 249 } else if (is_search() && 261 250 file_exists("$wp_template_dir/search.php")) { 262 $wp_did_template_redirect = true;263 251 include("$wp_template_dir/search.php"); 264 252 exit; 265 253 } else if (is_paged() && 266 254 file_exists("$wp_template_dir/paged.php")) { 267 $wp_did_template_redirect = true;268 255 include("$wp_template_dir/paged.php"); 269 256 exit; 270 257 } else if (file_exists("$wp_template_dir/index.php")) 271 258 { 272 $wp_did_template_redirect = true;273 259 include("$wp_template_dir/index.php"); 274 260 exit; trunk/wp-includes/classes.php
r1959 r1972 24 24 var $is_search = false; 25 25 var $is_feed = false; 26 var $is_trackback = false; 26 27 var $is_home = false; 27 28 var $is_404 = false; … … 40 41 $this->is_search = false; 41 42 $this->is_feed = false; 43 $this->is_trackback = false; 42 44 $this->is_home = false; 43 45 $this->is_404 = false; … … 62 64 if ('' != $qv['name']) { 63 65 $this->is_single = true; 64 } 65 66 if (($qv['p'] != '') && ($qv['p'] != 'all')) { 66 } else if (($qv['p'] != '') && ($qv['p'] != 'all')) { 67 67 $this->is_single = true; 68 } 69 70 if ('' != $qv['static'] || '' != $qv['pagename'] || '' != $qv['page_id']) { 68 } else if (('' != $qv['hour']) && ('' != $qv['minute']) &&('' != $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day'])) { 69 // If year, month, day, hour, minute, and second are set, a single 70 // post is being queried. 71 $this->is_single = true; 72 } else if ('' != $qv['static'] || '' != $qv['pagename'] || '' != $qv['page_id']) { 71 73 $this->is_page = true; 72 74 $this->is_single = false; 73 } 74 75 if ( (int) $qv['second']) { 76 $this->is_time = true; 77 $this->is_date = true; 78 } 79 80 if ( (int) $qv['minute']) { 81 $this->is_time = true; 82 $this->is_date = true; 83 } 84 85 if ( (int) $qv['hour']) { 86 $this->is_time = true; 87 $this->is_date = true; 88 } 89 90 if ( (int) $qv['day']) { 91 if (! $this->is_date) { 92 $this->is_day = true; 75 } else if (!empty($qv['s'])) { 76 $this->is_search = true; 77 } else { 78 // Look for archive queries. Dates, categories, authors. 79 80 if ( (int) $qv['second']) { 81 $this->is_time = true; 93 82 $this->is_date = true; 94 83 } 95 } 96 97 if ( (int) $qv['monthnum']) { 98 if (! $this->is_date) { 99 $this->is_month = true; 84 85 if ( (int) $qv['minute']) { 86 $this->is_time = true; 100 87 $this->is_date = true; 101 88 } 102 } 103 104 if ( (int) $qv['year']) { 105 if (! $this->is_date) { 106 $this->is_year = true; 89 90 if ( (int) $qv['hour']) { 91 $this->is_time = true; 107 92 $this->is_date = true; 108 93 } 109 } 110 111 if ( (int) $qv['m']) { 112 $this->is_date = true; 113 if (strlen($qv['m']) > 9) { 114 $this->is_time = true; 115 } else if (strlen($qv['m']) > 7) { 116 $this->is_day = true; 117 } else if (strlen($qv['m']) > 5) { 118 $this->is_month = true; 119 } else { 120 $this->is_year = true; 121 } 122 } 123 124 if ('' != $qv['w']) { 125 $this->is_date = true; 126 } 127 128 // If year, month, day, hour, minute, and second are set, a single 129 // post is being queried. 130 if (('' != $qv['hour']) && ('' != $qv['minute']) &&('' != $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day'])) { 131 $this->is_single = true; 132 } 133 134 if (!empty($qv['s'])) { 135 $this->is_search = true; 136 } 137 138 if (empty($qv['cat']) || ($qv['cat'] == 'all') || ($qv['cat'] == '0')) { 139 $this->is_category = false; 140 } else { 141 if (stristr($qv['cat'],'-')) { 94 95 if ( (int) $qv['day']) { 96 if (! $this->is_date) { 97 $this->is_day = true; 98 $this->is_date = true; 99 } 100 } 101 102 if ( (int) $qv['monthnum']) { 103 if (! $this->is_date) { 104 $this->is_month = true; 105 $this->is_date = true; 106 } 107 } 108 109 if ( (int) $qv['year']) { 110 if (! $this->is_date) { 111 $this->is_year = true; 112 $this->is_date = true; 113 } 114 } 115 116 if ( (int) $qv['m']) { 117 $this->is_date = true; 118 if (strlen($qv['m']) > 9) { 119 $this->is_time = true; 120 } else if (strlen($qv['m']) > 7) { 121 $this->is_day = true; 122 } else if (strlen($qv['m']) > 5) { 123 $this->is_month = true; 124 } else { 125 $this->is_year = true; 126 } 127 } 128 129 if ('' != $qv['w']) { 130 $this->is_date = true; 131 } 132 133 if (empty($qv['cat']) || ($qv['cat'] == 'all') || ($qv['cat'] == '0')) { 142 134 $this->is_category = false; 143 135 } else { 136 if (stristr($qv['cat'],'-')) { 137 $this->is_category = false; 138 } else { 139 $this->is_category = true; 140 } 141 } 142 143 if ('' != $qv['category_name']) { 144 144 $this->is_category = true; 145 145 } 146 }147 148 if ('' != $qv['category_name']) {149 $this->is_category = true;150 }151 146 152 // single, page, date, and search override category.153 if ($this->is_single || $this->is_page || $this->is_date || $this->is_search) {154 $this->is_category = false;155 }156 157 if ((empty($qv['author'])) || ($qv['author'] == 'all') || ($qv['author'] == '0')) { 158 $this->is_author = false;159 } else {160 $this->is_author = true;161 } 162 163 if ('' != $qv['author_name']) {164 $this->is_author = true;147 if ((empty($qv['author'])) || ($qv['author'] == 'all') || ($qv['author'] == '0')) { 148 $this->is_author = false; 149 } else { 150 $this->is_author = true; 151 } 152 153 if ('' != $qv['author_name']) { 154 $this->is_author = true; 155 } 156 157 if ( ($this->is_date || $this->is_author || $this->is_category)) { 158 $this->is_archive = true; 159 } 165 160 } 166 161 … … 169 164 } 170 165 166 if ('' != $qv['tb']) { 167 $this->is_trackback = true; 168 } 169 171 170 if ('404' == $qv['error']) { 172 171 $this->is_404 = true; … … 177 176 } 178 177 179 if ( ($this->is_date || $this->is_author || $this->is_category) 180 && (! ($this->is_single || $this->is_page)) ) { 181 $this->is_archive = true; 182 } 183 184 if ( ! ($this->is_archive || $this->is_single || $this->is_page || $this->is_search || $this->is_feed || $this->is_404)) { 178 if ( ! ($this->is_archive || $this->is_single || $this->is_page || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404)) { 185 179 $this->is_home = true; 186 180 } … … 900 894 } 901 895 902 function generate_rewrite_rules($permalink_structure = '', $page = true, $feed = true, $forcomments = false) {896 function generate_rewrite_rules($permalink_structure, $page = true, $feed = true, $forcomments = false, $walk_dirs = true) { 903 897 $feedregex2 = '(feed|rdf|rss|rss2|atom)/?$'; 904 898 $feedregex = 'feed/' . $feedregex2; trunk/wp-includes/functions.php
r1964 r1972 1196 1196 } 1197 1197 1198 function is_trackback () { 1199 global $wp_query; 1200 1201 return $wp_query->is_trackback; 1202 } 1203 1198 1204 function is_home () { 1199 1205 global $wp_query;
