All pastes #214347 Raw Edit

Untitled

public php v1 · immutable
#214347 ·published 2006-10-22 00:07 UTC
rendered paste body
function importnewimages() {    if (!$_REQUEST['list']) $_REQUEST['list'] = "1";    if ($handle = opendir("pictures/")) {        while (false !== ($file = readdir($handle))) {          $fileInfo = pathinfo("pictures/" . $file);          $extension = strtolower($fileInfo["extension"]);              if($this->inDB($file)  {                    $this->log("Importing '$file' (" . filesize("pictures/" . $file). " bytes)");                $imported = 0;                $imported++;                @chmod("pictures/" . $file,0644);            $this->createthumb($file);                    $this->log(" * finished creating thumbnails");            $this->addnew($file,$_REQUEST['list']);                    $this->log(" * finished adding file to database");                    $this->log(" = finished importing '$file'");              }        }    }    $this->write_iDB();    closedir($handle);        $this->updateDB();    return $imported;  }