本文整理匯總了PHP中printFiles函數的典型用法代碼示例。如果您正苦於以下問題:PHP printFiles函數的具體用法?PHP printFiles怎麽用?PHP printFiles使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了printFiles函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: printFiles
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 . '/');
}
}
}
示例2: printFiles
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/>";
}
}
}
示例3: setCurrentFile
* 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.
示例4: setCurrentFile
* 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
示例5: printFiles
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>";
}
}
示例6: printPathAsLinks
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>