Showing Diskspace used Showing Diskspace used
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Showing Diskspace used

Started by keiler83, June 27, 2005, 12:13:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

keiler83

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

Sebbit

Hallo!

I want to include THIS space.php file to my gallery statistic standing above all the albums ("xxx pictures in xxx albums" etc.), so that i have the text "xxx pictures in xxx albums, (...), with a total size of xxx MB"

How can I realize that?

Joachim Müller

merged your thread with the one you're refering to.