Hi, How do I display the space available on dashboard? any suggest? Thanks
Hi, How do I display the space available on dashboard? any suggest? Thanks
Search? :)
I'm assuming pictures. You may want to review the other threads covering this as it's been discussed in the past.
See line 32 in wpmu-functions.php. Might help cause I see
function wpmu_checkAvailableSpace($action) {
Thanks all!, I create a plugin files:
<?php
function space_limit() {
global $wpblog, $blog_id;
$spaceAllowed = get_site_option("blog_upload_space" );
if( $spaceAllowed == false )
$spaceAllowed = 10;
$dirName = ABSPATH."wp-content/blogs.dir/".$blog_id."/files/";
$dir = dir($dirName);
$size = 0;
while($file = $dir->read()) {
if ($file != '.' && $file != '..') {
if (is_dir($file)) {
$size += dirsize($dirName . '/' . $file);
} else {
$size += filesize($dirName . '/' . $file);
}
}
}
$dir->close();
$size = $size / 1024 / 1024;
?>
Upload Space Available : <?php printf( "%2.2f", ( ($spaceAllowed-$size) ) ) ?>MB
<img src="/wp-admin/images/space.gif" height="10px" width="<?php printf( "%2.2f", ( ($spaceAllowed-$size)*10 ) ) ?>%">
<?php
}
?>
and insert this code:
<?php space_limit();?>
Cool.
Is it worth submitting this as a patch to the Trac? This would probably be a welcomed addition to the code.
Tried testing it, got this on home.php. A clash with the other plugin. I uploaded spaceallowed.php into mu-plugins. Haven't even called it yet and I get this error. Any ideas Patrick?
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/bizblogo/public_html/wpmu/wp-inst/wp-content/mu-plugins/spaceallowed.php:36) in /home/bizblogo/public_html/wpmu/wp-inst/wp-content/mu-plugins/wp-hashcash.php on line 29
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/bizblogo/public_html/wpmu/wp-inst/wp-content/mu-plugins/spaceallowed.php:36) in /home/bizblogo/public_html/wpmu/wp-inst/wp-content/mu-plugins/wp-hashcash.php on line 29
You must put this code <?php space_limit();?> into Admin Panel. Not home.php.
Even before I add that into my admin panel, I have this error on my home.php. Hmm...
Make sure that you don't have any blank lines or spaces after the ?>
command at the end of the file.
Ok, we'll give it a try again. Thanks! :)
Hmm, I finally got around to trying this plugin and, from sticking in some echos into various points, it looks like it's going as far as the top subdirectory (ie '2006'), getting the size read off of that (ie 512) and reporting that. It's not finding the pictures within the subdirctories.
edit: If I point the $dirName line to an actual subdirectory with files, (ie files/2006/07) it works fine. Adds them up and all that. It's just not stepping through the subdirectories.