function printFiles($parentPath) { $directory = array_diff(scandir($parentPath), array('..', '.')); $leftNode[] = NULL; global $dirList; echo "<div class='textBackground'>"; echo "<form action='download.php' method='post' class='form'>"; $hasFiles = 0; foreach ($directory as $child) { if (!is_dir($parentPath . $child)) { if (auth('file', $_SESSION['user'], $parentPath . $child)) { if (!$hasFiles) { echo "<p class='pheader'>" . basename($parentPath) . "</p>"; } echo "<p class='pitems'>" . $child . "<input type='radio' name='file' value='" . hash('sha256', $parentPath . $child) . "'>" . "</p>"; $hasFiles = 1; } } else { array_push($leftNode, $child); } } if ($hasFiles) { echo "<input type='submit' value='Download''>"; } echo "</form>"; echo "</div>"; foreach ($leftNode as $dir) { if ($dir != NULL) { array_push($dirList, $parentPath . $dir . '/'); printFiles($parentPath . $dir . '/'); } } }
function printFiles($dir) { $list = glob($dir . "/*"); for ($i = 0; $i < count($list); $i++) { if (is_dir($list[$i])) { printFiles($list[$i]); } else { echo $list[$i] . "<br/>"; } } }
* Sets default skin. */ /** * Sets default skin. */ case 'setSkin': setCurrentFile($sModule, $sSkin, "skins"); break; /** * gets languages */ /** * gets languages */ case 'getLanguages': $sContents = printFiles($sModule, "langs", false, true); break; /** * Sets default language. */ /** * Sets default language. */ case 'setLanguage': setCurrentFile($sModule, $sLanguage, "langs"); break; /** * Get chat's config. */ /** * Get chat's config.
* Sets default skin. */ /** * Sets default skin. */ case 'setSkin': setCurrentFile($sModule, $sSkin, "skins"); break; /** * gets languages */ /** * gets languages */ case 'getLanguages': $sContents = printFiles($sModule, "langs"); break; /** * Sets default language. */ /** * Sets default language. */ case 'setLanguage': setCurrentFile($sModule, $sLanguage, "langs"); break; /** * Get mp3 config */ /** * Get mp3 config
function printFiles($files, $level, $fid) { foreach ($files as $folder => $file) { echo "<div class=\"{$fid} {$cf}"; if ($fid) { echo ' hidden'; } echo "\">"; if (!is_numeric($folder)) { $nfid = md5($folder . $level); echo "<div class=\"row\" onclick=\"cdir('{$nfid}')\">"; echo str_repeat(' ', $level); echo "<img src=\"images/ext/folder.png\" class=\"icon\"> {$folder}</div>"; printFiles($file, $level + 1, $nfid); } else { $ext = explode('.', $file[0]); $ext = $ext[count($ext) - 1]; echo "<div class=\"row\">"; echo str_repeat(' ', $level); echo "<img src=\"images/ext/file_extension_{$ext}.png\" class=\"icon\"> {$file[0]} - {$file[1]}</div>"; } echo "</div>"; } }
text-decoration: none; color: #ff0000; } a:visited { text-decoration: none; color: #000066; } </style> <div style="width: 400px;"> Listing: <?php printPathAsLinks($path); printDirectories($dirs, $path); printFiles($files, $path); ?> <hr> <form action=login.php method=post target=_top> <?php if ($requireLogin) { ?> <input type=hidden name=email value="<?php print $user['email']; ?> "><br> <?php } ?> Switch language:<br>