The MU forums have moved to

Listing the number of blogs? (4 posts)

  1. roguestar
    Posted 14 years ago #

    i saw on someones MU that the had a bit that said "we currently host 1234 blogs" which i thought looked rather good, how can i do that on my MU homepage? Whats the call for this function?


  2. Klark0
    Posted 14 years ago #

    Something like

    We currently host <?php
    $stats = get_sitestats();
    $tmp_blog_count = number_format ($stats[ 'blogs' ] );
    print "".$tmp_blog_count." blogs";

  3. roguestar
    Posted 14 years ago #

    wow, that was quick. it works great. thank you very much.

  4. eagano
    Posted 14 years ago #

    If you only want the blog count, and not other site stats, you can just use this:

    $sites = get_blog_count();

    This function is called by get_sitestats(), along with some others. It stores (caches) the value as a site option and recalculates it if the current stored value is older than one hour.

About this Topic

  • Started 14 years ago by roguestar
  • Latest reply from eagano