mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
New dashboard from mdawaffe. see #5750
git-svn-id: https://develop.svn.wordpress.org/trunk@6705 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+13
-89
@@ -1,13 +1,19 @@
|
||||
<?php
|
||||
|
||||
require_once('admin.php');
|
||||
|
||||
require( './includes/dashboard.php' );
|
||||
|
||||
wp_dashboard_setup();
|
||||
|
||||
function index_js() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery(function() {
|
||||
jQuery('#incominglinks').load('index-extra.php?jax=incominglinks');
|
||||
jQuery('#devnews').load('index-extra.php?jax=devnews');
|
||||
// jQuery('#planetnews').load('index-extra.php?jax=planetnews');
|
||||
jQuery('#dashboard_incoming_links div.dashboard-widget-content').not( '.dashboard-widget-control' ).load('index-extra.php?jax=incominglinks');
|
||||
jQuery('#dashboard_primary div.dashboard-widget-content').not( '.dashboard-widget-control' ).load('index-extra.php?jax=devnews');
|
||||
jQuery('#dashboard_secondary div.dashboard-widget-content').not( '.dashboard-widget-control' ).load('index-extra.php?jax=planetnews');
|
||||
jQuery('#dashboard_plugins div.dashboard-widget-content').not( '.dashboard-widget-control' ).html( 'TODO' );
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
@@ -77,94 +83,12 @@ $num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr',
|
||||
$widgets_text = sprintf( __ngettext( '%d widget', '%d widgets', $num_widgets ), $num_widgets );
|
||||
?>
|
||||
<p><?php printf( __( 'You are using %1$s theme with %2$s.' ), $ct->title, "<a href='widgets.php'>$widgets_text</a>" ); ?> <a href="themes.php" class="rbutton"><?php _e('Change Theme'); ?></a> You're using BetaPress TODO.</p>
|
||||
<p>
|
||||
<?php do_action( 'rightnow_end' ); ?>
|
||||
<?php do_action( 'activity_box_end' ); ?>
|
||||
</div>
|
||||
</div><!-- rightnow -->
|
||||
|
||||
<div id="dashboard-widgets">
|
||||
<?php wp_dashboard(); ?>
|
||||
|
||||
<div class="dashboard-widget">
|
||||
<div class="dashboard-widget-edit"><a href=""><?php _e('See All'); ?></a> | <a href=""><?php _e('Edit'); ?></a></div>
|
||||
<h3>Recent Comments</h3>
|
||||
</div><!-- wrap -->
|
||||
|
||||
<?php
|
||||
$comments = $wpdb->get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 5");
|
||||
$numcomments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'");
|
||||
|
||||
if ( $comments || $numcomments ) :
|
||||
?>
|
||||
|
||||
<?php if ( $numcomments ) : ?>
|
||||
<p><strong><a href="moderation.php"><?php echo sprintf(__('Comments in moderation (%s) »'), number_format_i18n($numcomments) ); ?></a></strong></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<ul>
|
||||
<?php
|
||||
if ( $comments ) {
|
||||
foreach ($comments as $comment) {
|
||||
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>');
|
||||
edit_comment_link(__("Edit"), ' <small>(', ')</small>');
|
||||
echo '</li>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="dashboard-widget">
|
||||
<?php
|
||||
$more_link = apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) );
|
||||
?>
|
||||
<div class="dashboard-widget-edit"><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('See All'); ?></a> | <a href=""><?php _e('Edit'); ?></a></div>
|
||||
<h3><?php _e('Incoming Links'); ?></h3>
|
||||
|
||||
<div id="incominglinks"></div>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-widget">
|
||||
<?php
|
||||
$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");
|
||||
?>
|
||||
<div class="dashboard-widget-edit"><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('See All'); ?></a> | <a href=""><?php _e('Edit'); ?></a></div>
|
||||
<h3>Recent Posts</h3>
|
||||
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($recentposts as $post) {
|
||||
if ($post->post_title == '')
|
||||
$post->post_title = sprintf(__('Post #%s'), $post->ID);
|
||||
echo "<li><a href='post.php?action=edit&post=$post->ID'>";
|
||||
the_title();
|
||||
echo '</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-widget">
|
||||
<div class="dashboard-widget-edit"><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('See All'); ?></a> | <a href=""><?php _e('Edit'); ?></a> | <a href=""><?php _e('RSS'); ?></a></div>
|
||||
<h3><?php echo apply_filters( 'dashboard_primary_title', __('Blog') ); ?></h3>
|
||||
|
||||
<div id="devnews"></div>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'dashboard_widgets' ); ?>
|
||||
|
||||
<p><a href=""><?php _e('Customize this page'); ?></a>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="planetnews"></div>
|
||||
|
||||
<div style="clear: both">
|
||||
<br clear="all" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require('./admin-footer.php');
|
||||
?>
|
||||
<?php require('./admin-footer.php'); ?>
|
||||
|
||||
Reference in New Issue
Block a user