Seite 2 von 2

Verfasst: 17.07.2004 14:56
von Berndte
hmm, die Anzahl stimmt nicht ganz... ich habe eigentlich 7 hochgeladene Dateien... es wird aber die leere index.htm mitgezählt... kann man einfach -1 irgendwo einbauen?

Verfasst: 17.07.2004 15:00
von Leuchte
functions.php

Code: Alles auswählen

$count_files[file] = 0;
Ersetzen mit

Code: Alles auswählen

$count_files[file] = -1;
;)

Verfasst: 17.07.2004 15:22
von Berndte
noch ein kleines Problem, wenn ich jetzt unter

Code: Alles auswählen

$uploadsize = get_dir_size_upload("./files/");
$avatarsize = get_dir_size_avatar("./images/avatars/gallery/");
$count_files_upload = count_files_upload("./files/");
noch

Code: Alles auswählen

$count_files_avatar = count_files_avatar("./images/avatars/gallery/");
einfüge, dann kommt:

Code: Alles auswählen

Warning: main(./includes/page_header.php): failed to open stream: No such file or directory in /home/ftp00072xvl/http/phpBB/index.php on line 265

Warning: main(): Failed opening './includes/page_header.php' for inclusion (include_path='.:/usr/local/lib/php:/usr/share/php') in /home/ftp00072xvl/http/phpBB/index.php on line 265
Template->make_filename(): Error - file ./templates/subSilver/index_body.tpl does not exist
angepasst ist auch:

functions.php

Code: Alles auswählen

function count_files_upload($dir) 
    { 
    if(is_dir($dir)) 
      { 
      $count_files_upload[file] = -1; 

      chdir($dir); 
      $handle = opendir("."); 
      while($file = readdir($handle)) 
        { 
        if(is_dir($file) && $file != "." && $file != "..") 
          { 
           $count_files_upload[file] += $y[file]; 
          }  
        if(is_file($file)) 
            { 
          $count_files_upload[file]++; 
            } 
          } 

    if(stristr($dir,"../")) chdir($_SERVER["DOCUMENT_ROOT"].substr($_SERVER["PATH_INFO"],0,strrpos($_SERVER["PATH_INFO"],"/"))); 
      elseif($dir != ".") chdir("../"); 

      closedir($handle); 
      } 

    return $count_files_upload; 
    }


function count_files_avatar($dir) 
    { 
    if(is_dir($dir)) 
      { 
      $count_files_avatar[file] = -1; 

      chdir($dir); 
      $handle = opendir("."); 
      while($file = readdir($handle)) 
        { 
        if(is_dir($file) && $file != "." && $file != "..") 
          { 
           $count_files_avatar[file] += $y[file]; 
          }  
        if(is_file($file)) 
            { 
          $count_files_avatar[file]++; 
            } 
          } 

    if(stristr($dir,"../")) chdir($_SERVER["DOCUMENT_ROOT"].substr($_SERVER["PATH_INFO"],0,strrpos($_SERVER["PATH_INFO"],"/"))); 
      elseif($dir != ".") chdir("../"); 

      closedir($handle); 
      } 

    return $count_files_avatar; 
    }
und index.php:

Code: Alles auswählen

$uploadsize = get_dir_size_upload("./files/");
$avatarsize = get_dir_size_avatar("./images/avatars/gallery/");
$count_files_upload = count_files_upload("./files/");
$count_files_avatar = count_files_avatar("./images/avatars/gallery/");

Verfasst: 17.07.2004 20:16
von Berndte
Leuchte, kannst du dich meiner noch mal bitte annehmen?

Ich gebe dann auch sicher Ruhe ;)

Edit: ich vermute, dass sich der Server nach obiger Zeile im Verzeichnis ("./images/avatars/gallery/") befindet und deshalb die benötigten dateien nicht finden kann... richtig? Bin ja PHP neuling ;)

Verfasst: 26.07.2004 19:58
von Berndte
nochmal was probiert:

Code: Alles auswählen

$count_files_upload = count_files_upload("/home/ftp00072xvl/http/phpBB/files/");
$count_files_avatar = count_files_avatar("/home/ftp00072xvl/http/phpBB/images/avatars/gallery/");
also mit /home/ftp00072xvl/http/phpBB/ ... aber funktioniert immer noch nicht!

Kann sich bitte nochmal einer dessen annehmen?

Verfasst: 04.08.2004 16:04
von Berndte
nochmal push