Location: PHPKode > projects > PHP-OS > PHP-OS BetaV2/ownFiles.php
<?php
include('connect.php');
include('includes.php');
$absolutePath=$_SERVER['SCRIPT_FILENAME'];
$absolutePath=preg_replace('/ownFiles.php/','',$absolutePath);
$searchPath=$absolutePath.'user/'.getUsername().'/ownFiles/';
echo'<div class="overLeiste"><input class="file" type="text" value="'.$spr[ownFiles].'/'.$folder.'" READONLY="READONLY" style="width:400px"><a href="javascript:newFolderWindow(\''.$searchPath.'\')">Neuer Ordner</a> <a href="javascript:newFileWindow(\''.$searchPath.'\')">Neue Datei</a><br>';
echo'<a id="showHideFiles" href="javascript:hideShowFiles()">'.$spr[showHideFile].'</a> <a id="showHideFolders" href="javascript:hideShowFolders()">'.$spr[showHideFolders].'</a></div>';

//$_SERVER['SERVER_NAME'].'/'.$order.'/user/'.getUsername().'/ownFiles/'
if ($handle = opendir($searchPath)) {


    /* Das ist der korrekte Weg, ein Verzeichnis zu durchlaufen. */
    while (false !== ($file = readdir($handle))) {
	if($file!='..'){
	if($file!='.'){
	if(is_dir($searchPath.$file)==false){
	
	$showfile=preg_replace("/(.*)\.(.*)/",'$1',$file);
	$symbol=getFileTypSymbol($showfile,$file);
	$functionfile='user/'.getUsername().'/ownFiles/'.$file;
	IF($symbol!='<img src="bilder/filetypes/image.png">'){
        echo "<a class='file' name='file' href='javascript:editFile(\"".$functionfile."\")'>$symbol $showfile <br></a>";
		} else {
		echo "<a class='file' name='file' href='javascript:ShowPicture(\"".$functionfile."\")'>$symbol $showfile <br></a>";
		}
		} else {
		echo'<a class="folder" name="folder" href="javascript:OwnFilesOpenFolder(\''.$file.'\')"> '.$file.'<br></a>';
		}
		}}
		
    }

    /* Dies ist der FALSCHE Weg, ein Verzeichnis zu durchlaufen. */
   /* while ($file = readdir($handle)) {
        echo "$file<br>";
    }*/

    closedir($handle);
}


?>
Return current item: PHP-OS