Changeset 4172
- Timestamp:
- 09/07/2006 05:38:43 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/general-template.php
r4171 r4172 326 326 foreach ( $arcresults as $arcresult ) { 327 327 $url = get_month_link($arcresult->year, $arcresult->month); 328 if ( $show_post_count ) {329 $text = sprintf('%s %d', $wp_locale->get_month($arcresult->month), $arcresult->year);328 $text = sprintf('%s %d', $wp_locale->get_month($arcresult->month), $arcresult->year); 329 if ( $show_post_count ) 330 330 $after = ' ('.$arcresult->posts.')' . $afterafter; 331 } else {332 $text = sprintf('%s %d', $wp_locale->get_month($arcresult->month), $arcresult->year);333 }334 331 echo get_archives_link($url, $text, $format, $before, $after); 335 332 } … … 341 338 foreach ($arcresults as $arcresult) { 342 339 $url = get_year_link($arcresult->year); 343 if ($show_post_count) { 344 $text = sprintf('%d', $arcresult->year); 340 $text = sprintf('%d', $arcresult->year); 341 if ($show_post_count) 345 342 $after = ' ('.$arcresult->posts.')' . $afterafter; 346 } else {347 $text = sprintf('%d', $arcresult->year);348 }349 343 echo get_archives_link($url, $text, $format, $before, $after); 350 344 } 351 345 } 352 346 } elseif ( 'daily' == $type ) { 353 $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth` FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'ORDER BY post_date DESC" . $limit);347 $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date DESC" . $limit); 354 348 if ( $arcresults ) { 349 $afterafter = $after; 355 350 foreach ( $arcresults as $arcresult ) { 356 351 $url = get_day_link($arcresult->year, $arcresult->month, $arcresult->dayofmonth); 357 352 $date = sprintf("%d-%02d-%02d 00:00:00", $arcresult->year, $arcresult->month, $arcresult->dayofmonth); 358 353 $text = mysql2date($archive_day_date_format, $date); 354 if ($show_post_count) 355 $after = ' ('.$arcresult->posts.')'.$afterafter; 359 356 echo get_archives_link($url, $text, $format, $before, $after); 360 357 } … … 362 359 } elseif ( 'weekly' == $type ) { 363 360 $start_of_week = get_option('start_of_week'); 364 $arcresults = $wpdb->get_results("SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'ORDER BY post_date DESC" . $limit);361 $arcresults = $wpdb->get_results("SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY WEEK(post_date, $start_of_week), YEAR(post_date) ORDER BY post_date DESC" . $limit); 365 362 $arc_w_last = ''; 363 $afterafter = $after; 366 364 if ( $arcresults ) { 367 365 foreach ( $arcresults as $arcresult ) { … … 374 372 $url = sprintf('%s/%s%sm%s%s%sw%s%d', get_option('home'), '', '?', '=', $arc_year, '&', '=', $arcresult->week); 375 373 $text = $arc_week_start . $archive_week_separator . $arc_week_end; 374 if ($show_post_count) 375 $after = ' ('.$arcresult->posts.')'.$afterafter; 376 376 echo get_archives_link($url, $text, $format, $before, $after); 377 377 }
Note: See TracChangeset
for help on using the changeset viewer.