public function recent_drafts($drafts = false) { ?> <h2><?php _e('Recent Drafts', 'ktai_style'); ?> </h2> <?php if (!$drafts) { $drafts_query = new WP_Query(array('post_type' => 'post', 'what_to_show' => 'posts', 'post_status' => 'draft', 'author' => $GLOBALS['current_user']->ID, 'posts_per_page' => 5, 'orderby' => 'modified', 'order' => 'DESC')); $drafts =& $drafts_query->posts; } if ($drafts && is_array($drafts)) { global $Ktai_Style; echo '<dl>'; foreach ($drafts as $draft) { $url = get_edit_post_link($draft->ID, 'url'); $title = $this->admin->draft_or_post_title($draft->ID); echo '<dt>'; ks_ordered_link($this->accesskey++, 10, $url, $title); _ks_timestamp(get_the_time('U', $draft)); echo '</dt>'; if ($the_content = ks_cut_html(strip_tags($draft->post_content), KTAI_DRAFT_LENGTH)) { echo '<dd>' . $the_content . '</dd>'; } } ?> </dl> <div align="right"><img localsrc="63" alt="→" /><a href="edit.php?post_status=draft"><?php _e('View all', 'ktai_style'); ?> </a></div> <?php } else { ?> <p><?php _e('There are no drafts at the moment', 'ktai_style'); ?> </p> <?php } return; }
function ks_get_comment_datetime($year = NULL, $mon_date = NULL, $today = NULL) { return _ks_timestamp(get_comment_time('U'), $year, $mon_date, $today, KTAI_NOT_ECHO); }