本文整理汇总了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>