Adding Site Stats to Nelo Header

Thanks in advance for any help. I searched and could not find any topics discussing what I am attempting here…

I’m trying to add the site stats that appear in the header of the Edu-Clean theme, to the WPMU Nelo header. I have succeeded in getting the stats to show, using the edited code below:

<div class="site-stats"><span>Currently home to <?php

$stats = get_sitestats();

$tmp_user_count = number_format ($stats[ 'users' ] );

$tmp_blog_count = number_format ($stats[ 'blogs' ] );

print "" . $tmp_user_count . " members" . "";

;?> and <?php

$stats = get_sitestats();

$tmp_user_count = number_format ($stats[ 'users' ] );

$tmp_blog_count = number_format ($stats[ 'blogs' ] );

print "" . $tmp_blog_count . " blogs" . "";


These stats, however, do not update when a new site is created, or a user is deleted. And, if I wrap all of the above with the following tags, the whole line of stat info does not print at all:

<?php if($multi_site_on == "true"){ ?>

// if code from above added here, nothing prints

<?php } ?>

When I first edited the header to add the code above (without the second php wrapper), the user count was correct, but the blogs count was less than the number shown in ms-sites. When I added a site an as existing user, the blog count did not change. Could this not be counting multiple sites owned by users? When I deleted a user, the user count did not change.

Any suggestions to get this working are greatly appreciated! Here is a link to the code in action.