From 80fe5b5d3954b777264579e8cad85ac515ec251f Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 5 Nov 2008 19:19:52 +0000 Subject: [PATCH] Show when future posts miss schedule, props hailin, fixes #8064 git-svn-id: https://develop.svn.wordpress.org/trunk@9529 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/css/colors-fresh.css | 4 ++++ wp-admin/includes/template.php | 28 +++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/wp-admin/css/colors-fresh.css b/wp-admin/css/colors-fresh.css index 48e1106874..21b6f38d1d 100644 --- a/wp-admin/css/colors-fresh.css +++ b/wp-admin/css/colors-fresh.css @@ -1073,3 +1073,7 @@ div.star.select:hover { border-color: #aaa; background: #ddd; } + +.attention { + color: #D54E21; +} diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 952770670d..9b3cb8d803 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1244,13 +1244,21 @@ function _post_row($a_post, $pending_comments, $mode) { $m_time = $post->post_date; $time = get_post_time('G', true, $post); - if ( ( abs(time() - $time) ) < 86400 ) { - if ( ( 'future' == $post->post_status) ) + $time_diff = time() - $time; + + if ( ( 'future' == $post->post_status) ) { + if ( $time_diff <= 0 ) { $h_time = sprintf( __('%s from now'), human_time_diff( $time ) ); - else - $h_time = sprintf( __('%s ago'), human_time_diff( $time ) ); + } else { + $h_time = $t_time; + $missed = true; + } } else { - $h_time = mysql2date(__('Y/m/d'), $m_time); + + if ( $time_diff > 0 && $time_diff < 24*60*60 ) + $h_time = sprintf( __('%s ago'), human_time_diff( $time ) ); + else + $h_time = mysql2date(__('Y/m/d'), $m_time); } } @@ -1260,10 +1268,16 @@ function _post_row($a_post, $pending_comments, $mode) { else echo '' . apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) . ''; echo '
'; - if ( 'publish' == $post->post_status || 'future' == $post->post_status ) + if ( 'publish' == $post->post_status ) { _e('Published'); - else + } elseif ( 'future' == $post->post_status ) { + if ( isset($missed) ) + echo '' . __('Missed schedule') . ''; + else + _e('Scheduled'); + } else { _e('Last Modified'); + } echo ''; break;