Changeset 1931 for trunk/wp-includes/template-functions-category.php
- Timestamp:
- 12/09/2004 01:30:34 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/template-functions-category.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-category.php
r1908 r1931 328 328 } 329 329 330 if (intval($optiondates) == 1) { 331 $cat_dates = $wpdb->get_results(" SELECT cat_ID, 332 DAYOFMONTH(MAX(post_date)) AS lastday, MONTH(MAX(post_date)) AS lastmonth 333 FROM $wpdb->categories 334 LEFT JOIN $wpdb->post2cat ON (cat_ID = category_id) 335 LEFT JOIN $wpdb->posts ON (ID = post_id) 336 WHERE post_status = 'publish' $exclusions 330 if ( $optiondates ) { 331 $cat_dates = $wpdb->get_results(" SELECT category_id, 332 UNIX_TIMESTAMP( MAX(post_date) ) AS ts 333 FROM $wpdb->posts, $wpdb->post2cat 334 WHERE post_status = 'publish' AND post_id = ID $exclusions 337 335 GROUP BY category_id"); 338 336 foreach ($cat_dates as $cat_date) { 339 $category_lastday["$cat_date->cat_ID"] = $cat_date->lastday; 340 $category_lastmonth["$cat_date->cat_ID"] = $cat_date->lastmonth; 337 $category_timestamp["$cat_date->category_id"] = $cat_date->ts; 341 338 } 342 339 } … … 402 399 $link .= ' ('.intval($category_posts["$category->cat_ID"]).')'; 403 400 } 404 if (intval($optiondates) == 1) { 405 $link .= ' '.$category_lastday["$category->cat_ID"].'/'.$category_lastmonth["$category->cat_ID"]; 401 if ( $optiondates ) { 402 if ( $optiondates == 1 ) $optiondates = 'Y-m-d'; 403 $link .= ' ' . gmdate($optiondates, $category_timestamp["$category->cat_ID"]); 406 404 } 407 405 if ($list) {
Note: See TracChangeset
for help on using the changeset viewer.