Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/index.php

    r5191 r4658  
    1616add_action( 'admin_head', 'index_js' );
    1717wp_enqueue_script('prototype');
    18 wp_enqueue_script('interface');
    1918
    2019$title = __('Dashboard');
     
    5150if ( $comments ) {
    5251foreach ($comments as $comment) {
    53     echo '<li>' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . apply_filters('the_title', get_the_title($comment->comment_post_ID)) . '</a>');
     52    echo '<li>' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . get_the_title($comment->comment_post_ID) . '</a>');
    5453    edit_comment_link(__("Edit"), ' <small>(', ')</small>');
    5554    echo '</li>';
     
    6261
    6362<?php
    64 if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql('post') . " AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 5") ) :
     63if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 5") ) :
    6564?>
    6665<div>
     
    10099<h3><?php _e('Blog Stats'); ?></h3>
    101100<?php
    102 $numposts = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'");
    103 $numcomms = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
    104 $numcats  = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->categories");
     101$numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'");
     102if (0 < $numposts) $numposts = number_format($numposts);
    105103
    106 $post_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Posts">post</a>', '%1$s <a href="%2$s" title="Posts">posts</a>', $numposts), number_format($numposts), 'edit.php');
    107 $comm_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Comments">comment</a>', '%1$s <a href="%2$s" title="Comments">comments</a>', $numcomms), number_format($numcomms), 'edit-comments.php');
    108 $cat_str  = sprintf(__ngettext('%1$s <a href="%2$s" title="Categories">category</a>', '%1$s <a href="%2$s" title="Categories">categories</a>', $numcats), number_format($numcats), 'categories.php');
     104$numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
     105if (0 < $numcomms) $numcomms = number_format($numcomms);
     106
     107$numcats = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->categories");
     108if (0 < $numcats) $numcats = number_format($numcats);
    109109?>
     110<p><?php
     111$post_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Posts">post</a>', '%1$s <a href="%2$s" title="Posts">posts</a>', $numposts), $numposts, 'edit.php');
     112$comm_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Comments">comment</a>', '%1$s <a href="%2$s" title="Comments">comments</a>', $numcomms), $numcomms, 'edit-comments.php');
     113$cat_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Categories">category</a>', '%1$s <a href="%2$s" title="Categories">categories</a>', $numcats), $numcats, 'categories.php');
    110114
    111 <p><?php printf(__('There are currently %1$s and %2$s, contained within %3$s.'), $post_str, $comm_str, $cat_str); ?></p>
     115printf(__('There are currently %1$s and %2$s, contained within %3$s.'), $post_str, $comm_str, $cat_str); ?></p>
    112116</div>
    113117
     
    123127    <li><a href="profile.php"><?php _e('Update your profile or change your password'); ?></a></li>
    124128<?php if ( current_user_can('manage_links') ) : ?>
    125     <li><a href="link-add.php"><?php _e('Add a link to your blogroll'); ?></a></li>
     129    <li><a href="link-add.php"><?php _e('Add a bookmark to your blogroll'); ?></a></li>
    126130<?php endif; ?>
    127131<?php if ( current_user_can('switch_themes') ) : ?>
Note: See TracChangeset for help on using the changeset viewer.