The MU forums have moved to WordPress.org

display the stats numbers of the dashboard (6 posts)

  1. enseignement
    Member
    Posted 15 years ago #

    Hello,

    I would like to display outside wpmu the numbers that are in my admin dashboard counting the number of blogs, posts, comments, etc.

    How could I do that, on my blog frontpage but also on other pages (outside wpmu) ?

    Thanks

  2. tdjcbe
    Member
    Posted 15 years ago #

    excuse typos. 37 degress on becnh waiting for salvation army volunteering.

    n blogs > http://trac.mu.wordpress.org/browser/trunk/wp-admin/wpmu-admin.php line 18 down.

    other two -> nothing built in. look at list all plugins for functions to run through all of the blogs and count them one at a time. each blogs option db table. get_option('post_count'). add together.

    could have asworn that there comment count.

    hope helps

  3. Bill008
    Member
    Posted 15 years ago #

    Yeah I have done this on http://freeblog.co.nz Just Under the header

    Add this to your Header.php in your Home Theme directory

    <?php
    global $wpdb;
    $c_users = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->users}");
    $c_blogs = $wpdb->get_var("SELECT COUNT(blog_id) FROM {$wpdb->blogs}");
    $c_posts = $wpdb->get_var("SELECT COUNT(post_id) FROM {$wpdb->blogs}");
    
    $user_text = sprintf( __ngettext( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) );
    $blog_text = sprintf( __ngettext( '%s blog', '%s blogs', $c_blogs ), number_format_i18n( $c_blogs ) );
    //$post_text = sprintf( __ngettext( '%s post', '%s posts', $c_posts ), number_format_i18n( $c_posts ) );
    
    $sentence = sprintf( __( 'Free Blog Now has <span>%1$s</span> and <span>%2$s.</span>' ), $blog_text, $user_text );
    ?>

    I have added some span elements above so I can adjust the font thru CSS Later!

    Then add this hook line into where you want to produce the result

    <?php echo $sentence; ?>

    Mine Looks Like this
    <h3 > Creating a Free Blog is Easy ! <?php echo $sentence; ?></h3>

    I hope its acceptable to put code here any way this works FOR ME

    Enjoy

    Bill007

  4. leisegang
    Member
    Posted 14 years ago #

    why doesnt the post count work?

  5. cafespain
    Member
    Posted 14 years ago #

    because it's searching the wrong table.

  6. enseignement
    Member
    Posted 14 years ago #

    Is this working for you ?
    Does not seem to work for me on a multidb install.

About this Topic

  • Started 15 years ago by enseignement
  • Latest reply from enseignement