images)){
echo „

„;
echo ‚

‚;
foreach($this->images as $img) {
echo „

„;
}
echo ‚

‚;
}
echo „

„;
echo „

„;
echo „

„.$img.“

„;
echo „

„;
}

public function showImagesToo(){

if(sizeof($this->images)){
foreach($this->images as $img) {
echo „

„;
echo „

„;
echo „


„.$img.“

„;
}
}
}

public function setPath($path){

$this->path = $path;

}

public function scan($pfad, $index = 0) {
if (!$pfad) return false;
if (!is_dir($pfad)) {
echo „Dieses Verzeichnis existiert nicht

„;
return false;

}
else
{
$ordner = scandir($pfad);

foreach($ordner as $file){
$f = pathinfo($pfad.“/“.$file);

if(in_array($f[‚extension‘], array(‚jpg‘,’jpeg‘,’png‘,’JPG‘,’JPEG‘,’PNG‘))){ // Bild
$this->images[] = $pfad.“/“.$file;
} elseif(is_dir($pfad.“/“.$file) and !in_array($file, [’sampledata‘,’joomlart‘,’icons‘,’democontent‘,’c‘,‘.‘, ‚..‘])) {

if($index <= $this->maxEbenen){
$this->scan($pfad.“/“.$file, $index + 1);
}
}

$this->ordnerIndex++;
}
}
}
public function start(){
if(!$this->path){
echo „Bitte setzen Sie den Pfad.
„;
}

$this->scan($this->path);

if($this->ordnerIndex){
echo $this->ordnerIndex.“ Ordner durchsucht
„;
}

echo sizeof($this->images).“ Bilder gefunden…
„;

if(sizeof($this->images)){

$this->showImagesToo();

}
}

}

$suchpfad = $_POST[‚pfad‘];
$folder = new scanFolder();
$folder->setPath($suchpfad);

if ($_POST[‚pfad‘] != „“)
{
$folder->start();
}
else
{
echo „Bitte einen Ordner angeben!“;
return false;
}
?>