mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Post status = future. #2426
git-svn-id: https://develop.svn.wordpress.org/trunk@3514 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -327,10 +327,8 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
|
||||
$add_hours = intval(get_settings('gmt_offset'));
|
||||
$add_minutes = intval(60 * (get_settings('gmt_offset') - $add_hours));
|
||||
|
||||
$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_date != '0000-00-00 00:00:00' AND post_type = 'post' 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_type = 'post' 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 ) {
|
||||
@@ -345,7 +343,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_date != '0000-00-00 00:00:00' AND post_type = 'post' 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_type = 'post' 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);
|
||||
@@ -356,7 +354,7 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
|
||||
}
|
||||
} elseif ( 'weekly' == $type ) {
|
||||
$start_of_week = get_settings('start_of_week');
|
||||
$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_date < '$now' AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
|
||||
$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);
|
||||
$arc_w_last = '';
|
||||
if ( $arcresults ) {
|
||||
foreach ( $arcresults as $arcresult ) {
|
||||
@@ -373,7 +371,7 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
|
||||
}
|
||||
}
|
||||
} elseif ( 'postbypost' == $type ) {
|
||||
$arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_date < '$now' AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
|
||||
$arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
|
||||
if ( $arcresults ) {
|
||||
foreach ( $arcresults as $arcresult ) {
|
||||
if ( $arcresult->post_date != '0000-00-00 00:00:00' ) {
|
||||
|
||||
Reference in New Issue
Block a user