Hey guys!
Im trying to put a line into the nav-sidebar of my gallery, which says how much diskspace all albums (gallery uses $totaldirectorysize Kilobyte) use, but according to my new topic here unsuccessful. Does anyone of you know how to get that to work?
I've already tried to do it with some of the code that is used in each profile (disk quota), but never got it right.
Thanks in advance.
edit:
Im almost done with that, just need a lil bit help to finish it:
ive created a space.php in the directory albums with this content:
<?
function readsize_recursiv($path)
{
$s = 0;
$result[$path] = 0;
$handle = opendir($path);
if ($handle)
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
$name = $path . "/" . $file;
if (is_dir($name))
{
$ar = readsize_recursiv($name);
while (list($key, $value) = each ($ar))
{
$s++;
$result[$key] = $value;
}
}
else
{
$result[$path] += filesize($name);
}
}
}
}
closedir($handle);
return $result;
}
$data = readsize_recursiv(".");
$summe = 0;
while (list($key, $value) = each ($data))
{
$summe += ($value / (1048576));
round($summe, 2);
}
echo "Size:<br>",
round($summe, 2);
echo " MB";
?>
If you open that file from that directory, it shows the disk space used in that directory and all subdirectories. Fine, that works finally.
But how do i include that on the main site?
include function in theme.php doesnt work...it wont show any of the "echo" content
ive already got a custom header and im not sure if i can have a second one. plus, i think that script needs to be run directly from the albums directory
Any ideas?
last edit: SOLVED...found out how to do that...
Greets KEiLER