All pastes #214334 Raw Edit

Untitled

public php v1 · immutable
#214334 ·published 2006-10-21 23:58 UTC
rendered paste body
function importnewimages(){    $allowed_extensions = explode(",", $this->extensions);    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++;              @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;    }  }