mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 23:41:38 +01:00
Don't show 0 as a month.
git-svn-id: http://svn.automattic.com/wordpress/trunk@3202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e8f47bf315
commit
45c73a3298
@ -494,7 +494,7 @@ function checked($checked, $current) {
|
||||
|
||||
function return_categories_list($parent = 0) {
|
||||
global $wpdb;
|
||||
return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent");
|
||||
return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY category_count DESC LIMIT 100");
|
||||
}
|
||||
|
||||
function sort_cats($cat1, $cat2) {
|
||||
|
@ -81,7 +81,8 @@ if ( is_month() ) {
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<?php $arc_result = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts ORDER BY post_date DESC");
|
||||
<?php $arc_result = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_date != '0000-00-00 00:00:00' ORDER BY post_date DESC");
|
||||
|
||||
if ( count($arc_result) ) { ?>
|
||||
|
||||
<form name="viewarc" action="" method="get" style="float: left; width: 20em; margin-bottom: 1em;">
|
||||
|
@ -323,7 +323,7 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
|
||||
$now = current_time('mysql');
|
||||
|
||||
if ( 'monthly' == $type ) {
|
||||
$arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_date < '$now' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit);
|
||||
$arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_date < '$now' AND post_date != '0000-00-00 00:00:00' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit);
|
||||
if ( $arcresults ) {
|
||||
$afterafter = $after;
|
||||
foreach ( $arcresults as $arcresult ) {
|
||||
@ -338,7 +338,7 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
|
||||
}
|
||||
}
|
||||
} elseif ( 'daily' == $type ) {
|
||||
$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_date < '$now' AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
|
||||
$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_date < '$now' AND post_date != '0000-00-00 00:00:00' AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
|
||||
if ( $arcresults ) {
|
||||
foreach ( $arcresults as $arcresult ) {
|
||||
$url = get_day_link($arcresult->year, $arcresult->month, $arcresult->dayofmonth);
|
||||
|
Loading…
Reference in New Issue
Block a user