本文整理汇总了PHP中formatfilesize函数的典型用法代码示例。如果您正苦于以下问题:PHP formatfilesize函数的具体用法?PHP formatfilesize怎么用?PHP formatfilesize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了formatfilesize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: recursive_directory_size
function recursive_directory_size($directory, $format = FALSE)
{
$size = 0;
if (substr($directory, -1) == '/') {
$directory = substr($directory, 0, -1);
}
if (!file_exists($directory) || !is_dir($directory) || !is_readable($directory)) {
return -1;
}
if ($handle = opendir($directory)) {
while (($file = readdir($handle)) !== false) {
$path = $directory . '/' . $file;
if ($file != '.' && $file != '..') {
if (is_file($path)) {
$size += filesize($path);
} elseif (is_dir($path)) {
$handlesize = recursive_directory_size($path);
if ($handlesize >= 0) {
$size += $handlesize;
} else {
return -1;
}
}
}
}
closedir($handle);
}
if ($format == TRUE) {
return formatfilesize($size);
} else {
return $size;
}
}
示例2: number_format
echo $lang["searchitemsdiskusage"];
?>
</h1>
<div class="Question">
<label><?php
echo $lang["matchingresourceslabel"];
?>
</label>
<div class="Fixed"><?php
echo number_format($count);
?>
</div>
<div class="clearerleft"></div>
</div>
<div class="Question">
<label><?php
echo $lang["diskusage"];
?>
</label>
<div class="Fixed"><strong> <?php
echo formatfilesize($disk_usage);
?>
</strong></div>
<div class="clearerleft"></div>
</div>
<?php
include "../include/footer.php";
示例3: resize
function resize($filename, $resize_width, $resize_height, $texttype = false, $filename_src)
{
global $config, $_POST, $error;
$ext = strtolower(strrchr(basename($filename), "."));
// Получаем формат уменьшаемого изображения
$info = getimagesize($filename);
// Возвращает ширину и высоту картинки
$width = $info['0'];
$height = $info['1'];
if ($resize_height > $height or $resize_width > $width) {
$error[] = "Нельзя уменьшать изображение в большую сторону";
} else {
list($resize_width, $resize_height) = get_resize_proportions($height, $width, $resize_height, $resize_width);
$type = '';
if (!$info['mime']) {
switch ($ext) {
case '.gif':
$type = 'gif';
break;
case '.png':
$type = 'png';
break;
case '.jpg':
$type = 'jpg';
break;
case '.jpeg':
$type = 'jpg';
break;
//case '.bmp' : $type='bmp'; break; - здесь уже не должно быть BMP
}
} else {
switch ($info['mime']) {
case 'image/gif':
$type = 'gif';
break;
case 'image/pjpeg':
$type = 'jpg';
break;
case 'image/jpeg':
$type = 'jpg';
break;
case 'image/x-png':
$type = 'png';
break;
case 'image/png':
$type = 'png';
break;
//case 'image/bmp' : $type='bmp'; break; - здесь уже не должно быть BMP
//case 'image/x-ms-bmp' : $type='bmp'; break;
}
}
if ($type != '') {
include_once 'gdenhancer/GDEnhancer.php';
//path of GDEnhancer.php
$image = new GDEnhancer($filename);
$image->backgroundResize($resize_width, $resize_height, 'shrink');
//option shrink
//текст на превью
if (isset($texttype) and $texttype and $texttype != "nothing") {
$filesize = formatfilesize(filesize($filename));
if ($texttype == 'dimensions') {
$text = $width . 'x' . $height . '(' . $filesize . ')';
} else {
$text = $_POST['text'];
}
$DARKNESS = 70;
//FIXME: вынести в конфиг!
//"полупрозрачный" слой подложки под текст
$imglayer = imagecreatetruecolor($width, 15);
imagesavealpha($imglayer, true);
$color = imagecolorallocatealpha($imglayer, 0, 0, 0, $DARKNESS);
imagefill($imglayer, 0, 0, $color);
ob_start();
imagepng($imglayer);
$image_data = ob_get_contents();
ob_end_clean();
imagedestroy($imglayer);
$image->layerImage($image_data);
$image->layerMove(0, "top", 0, $resize_height - 15);
$save = $image->save();
unset($image);
//сам текст
$image = new GDEnhancer($save['contents']);
$image->layerText($text, $config['site_dir'] . "/K1FS.ttf", '10', '#FFFFFF', 0, 1);
$image->layerMove(0, "top", 2, $resize_height - 14);
}
$save = $image->save();
file_put_contents($filename, $save['contents']);
unset($image);
}
}
//else resize_height>height
}
示例4: htmlspecialchars
<!--List Item-->
<tr>
<td><?php
echo htmlspecialchars($files[$n]["name"]);
?>
</td>
<td><?php
echo htmlspecialchars($files[$n]["description"]);
?>
</td>
<td><?php
echo $files[$n]["file_extension"] == "" ? $lang["notuploaded"] : htmlspecialchars(str_replace_formatted_placeholder("%extension", $files[$n]["file_extension"], $lang["cell-fileoftype"]));
?>
</td>
<td><?php
echo formatfilesize($files[$n]["file_size"]);
?>
</td>
<td><?php
echo nicedate($files[$n]["creation_date"], true);
?>
</td>
<?php
if (count($alt_types) > 1) {
?>
<td><?php
echo $files[$n]["alt_type"];
?>
</td><?php
}
?>
示例5: sql_query
# get all resources in the DB
$resources = sql_query("select ref,field" . $view_title_field . ",file_extension from resource where ref>0 order by ref DESC");
//loop:
foreach ($resources as $resource) {
$resource_path = get_resource_path($resource['ref'], true, "", false, $resource['file_extension']);
if (file_exists($resource_path)) {
$filesize = filesize_unlimited($resource_path);
sql_query("update resource_dimensions set file_size={$filesize} where resource='" . $resource['ref'] . "'");
echo "Ref: " . $resource['ref'] . " - " . $resource['field' . $view_title_field] . " - updating resource_dimensions file_size column - " . formatfilesize($filesize);
echo "<br />";
}
$alt_files = sql_query("select file_extension,file_name,ref from resource_alt_files where resource=" . $resource['ref']);
if (count($alt_files) > 0) {
foreach ($alt_files as $alt) {
$alt_path = get_resource_path($resource['ref'], true, "", false, $alt['file_extension'], -1, 1, false, "", $alt['ref']);
if (file_exists($alt_path)) {
// allow to re-run script without re-copying files
$filesize = filesize_unlimited($alt_path);
sql_query("update resource_alt_files set file_size={$filesize} where resource='" . $resource['ref'] . "' and ref='" . $alt['ref'] . "'");
echo " ALT - " . $alt['file_name'] . " - updating alt file size - " . formatfilesize($filesize);
echo "<br />";
}
}
}
update_disk_usage($resource['ref']);
echo "updating disk usage";
echo "<br />";
echo "<br />";
flush();
ob_flush();
}
示例6: get_resource_path
<div class="Fixed">
<?php
if ($resource["has_image"]==1)
{
?><img align="top" src="<?php echo get_resource_path($ref,false,($edit_large_preview?"pre":"thm"),false,$resource["preview_extension"],-1,1,checkperm("w"))?>" class="ImageBorder" style="margin-right:10px;"/><br />
<?php
}
else
{
# Show the no-preview icon
?>
<img src="../gfx/<?php echo get_nopreview_icon($resource["resource_type"],$resource["file_extension"],true)?>" />
<br />
<?php
}
if ($resource["file_extension"]!="") { ?><strong><?php echo str_replace_formatted_placeholder("%extension", $resource["file_extension"], $lang["cell-fileoftype"]) . " (" . formatfilesize(@filesize_unlimited(get_resource_path($ref,true,"",false,$resource["file_extension"]))) . ")" ?></strong><br /><?php } ?>
<?php if ($resource["has_image"]!=1) { ?>
<a href="<?php echo $baseurl_short?>pages/upload.php?ref=<?php echo urlencode($ref) ?>&search=<?php echo urlencode($search)?>&offset=<?php echo urlencode($offset) ?>&order_by=<?php echo urlencode($order_by) ?>&sort=<?php echo urlencode($sort) ?>&archive=<?php echo urlencode($archive) ?>&upload_a_file=true" onClick="return CentralSpaceLoad(this,true);">> <?php echo $lang["uploadafile"]?></a>
<?php } else { ?>
<a href="<?php echo $baseurl_short?>pages/upload_<?php echo $top_nav_upload_type ?>.php?ref=<?php echo urlencode($ref) ?>&search=<?php echo urlencode($search)?>&offset=<?php echo urlencode($offset) ?>&order_by=<?php echo urlencode($order_by) ?>&sort=<?php echo urlencode($sort) ?>&archive=<?php echo urlencode($archive) ?>&replace_resource=<?php echo urlencode($ref) ?>&resource_type=<?php echo $resource['resource_type']?>" onClick="return CentralSpaceLoad(this,true);">> <?php echo $lang["replacefile"]?></a>
<?php hook("afterreplacefile"); ?>
<?php } ?>
<?php if (! $disable_upload_preview) { ?><br />
<a href="<?php echo $baseurl_short?>pages/upload_preview.php?ref=<?php echo urlencode($ref) ?>&search=<?php echo urlencode($search)?>&offset=<?php echo urlencode($offset) ?>&order_by=<?php echo urlencode($order_by) ?>&sort=<?php echo urlencode($sort) ?>&archive=<?php echo urlencode($archive) ?>" onClick="return CentralSpaceLoad(this,true);">> <?php echo $lang["uploadpreview"]?></a><?php } ?>
<?php if (! $disable_alternative_files) { ?><br />
<a href="<?php echo $baseurl_short?>pages/alternative_files.php?ref=<?php echo urlencode($ref) ?>&search=<?php echo urlencode($search)?>&offset=<?php echo urlencode($offset) ?>&order_by=<?php echo urlencode($order_by) ?>&sort=<?php echo urlencode($sort) ?>&archive=<?php echo urlencode($archive) ?>" onClick="return CentralSpaceLoad(this,true);">> <?php echo $lang["managealternativefiles"]?></a><?php } ?>
<?php if ($allow_metadata_revert){?><br />
<a href="<?php echo $baseurl_short?>pages/edit.php?ref=<?php echo urlencode($ref) ?>&exif=true&search=<?php echo urlencode($search)?>&offset=<?php echo urlencode($offset) ?>&order_by=<?php echo urlencode($order_by) ?>&sort=<?php echo urlencode($sort) ?>&archive=<?php echo urlencode($archive) ?>" onClick="return confirm('<?php echo $lang["confirm-revertmetadata"]?>');">>
<?php echo $lang["action-revertmetadata"]?></a><?php } ?>
<?php hook("afterfileoptions"); ?>
示例7: round
: <b><?php
echo round(($avail ? $used / $avail : 0) * 100, 0);
?>
%</b> (<?php
echo $lang["available"];
?>
: <?php
echo formatfilesize($avail);
?>
; <?php
echo $lang["used"];
?>
: <?php
echo formatfilesize($used);
?>
; <?php
echo $lang["free"];
?>
: <?php
echo formatfilesize($free);
?>
)
</p>
<?php
}
?>
</div>
<?php
include "../../include/footer.php";
示例8: get_resource_access
}
}
}
if ($original) {
for ($i = 0; $i < count($results); $i++) {
$access = get_resource_access($results[$i]);
$filepath = get_resource_path($results[$i]['ref'], TRUE, '', FALSE, $results[$i]['file_extension'], -1, 1, FALSE, '', -1);
$original_link = get_resource_path($results[$i]['ref'], FALSE, '', FALSE, $results[$i]['file_extension'], -1, 1, FALSE, '', -1);
if (file_exists($filepath)) {
$results[$i]['original_link'] = $original_link;
} else {
$results[$i]['original_link'] = 'No original link available.';
}
// Get the size of the original file:
$original_size = get_original_imagesize($results[$i]['ref'], $filepath, $results[$i]['file_extension']);
$original_size = formatfilesize($original_size[0]);
$original_size = str_replace(' ', ' ', $original_size);
$results[$i]['original_size'] = $original_size;
}
}
// flv file and thumb if available
if (getval("flvfile", "") != "") {
for ($n = 0; $n < count($results); $n++) {
// flv previews
$flvfile = get_resource_path($results[$n]['ref'], true, "pre", false, $ffmpeg_preview_extension);
if (!file_exists($flvfile)) {
$flvfile = get_resource_path($results[$n]['ref'], true, "", false, $ffmpeg_preview_extension);
}
if (!(isset($results[$n]['is_transcoding']) && $results[$n]['is_transcoding'] == 1) && file_exists($flvfile) && strpos(strtolower($flvfile), "." . $ffmpeg_preview_extension) !== false) {
if (file_exists(get_resource_path($results[$n]['ref'], true, "pre", false, $ffmpeg_preview_extension))) {
$flashpath = get_resource_path($results[$n]['ref'], false, "pre", false, $ffmpeg_preview_extension, -1, 1, false, "", -1, false);
示例9: define
}
if (!defined('SUB_PAGE')) {
define('SUB_PAGE', 'Reports & Stats');
}
$vid_dir = get_directory_size(VIDEOS_DIR);
$thumb_dir = get_directory_size(THUMBS_DIR);
$orig_dir = get_directory_size(ORIGINAL_DIR);
$user_thumbs = get_directory_size(USER_THUMBS_DIR);
$user_bg = get_directory_size(USER_BG_DIR);
$grp_thumbs = get_directory_size(GP_THUMB_DIR);
$cat_thumbs = get_directory_size(CAT_THUMB_DIR);
assign('vid_dir', $vid_dir);
assign('thumb_dir', $thumb_dir);
assign('orig_dir', $orig_dir);
assign('user_thumbs', $user_thumbs);
assign('user_bg', $user_bg);
assign('grp_thumbs', $grp_thumbs);
assign('cat_thumbs', $cat_thumbs);
if (!defined('MAIN_PAGE')) {
define('MAIN_PAGE', 'Stats And Configurations');
}
if (!defined('SUB_PAGE')) {
if ($_GET['view'] == 'search') {
define('SUB_PAGE', 'Search Members');
} else {
define('SUB_PAGE', 'Reports & Stats');
}
}
assign('db_size', formatfilesize(get_db_size()));
template_files('reports.html');
display_it();
示例10: preview
if (file_exists($alt_pre_file))
{
# Get web path for preview (pass creation date to help cache refresh)
$alt_pre=get_resource_path($ref,false,"pre",false,"jpg",-1,1,false,$altfiles[$n]["creation_date"],$altfiles[$n]["ref"]);
}
}
?>
<tr class="DownloadDBlend" <?php if ($alt_pre!="" && $alternative_file_previews_mouseover) { ?>onMouseOver="orig_preview=jQuery('#previewimage').attr('src');orig_width=jQuery('#previewimage').width();jQuery('#previewimage').attr('src','<?php echo $alt_pre ?>');jQuery('#previewimage').width(orig_width);" onMouseOut="jQuery('#previewimage').attr('src',orig_preview);"<?php } ?>>
<td>
<?php if(!hook("renderaltthumb")): ?>
<?php if ($alt_thm!="") { ?><a href="<?php echo $baseurl_short?>pages/preview.php?ref=<?php echo urlencode($ref)?>&alternative=<?php echo $altfiles[$n]["ref"]?>&k=<?php echo urlencode($k)?>&search=<?php echo urlencode($search)?>&offset=<?php echo urlencode($offset)?>&order_by=<?php echo urlencode($order_by)?>&sort=<?php echo urlencode($sort)?>&archive=<?php echo urlencode($archive)?>&<?php echo hook("previewextraurl") ?>"><img src="<?php echo $alt_thm?>" class="AltThumb"></a><?php } ?>
<?php endif; ?>
<h2><?php echo htmlspecialchars($altfiles[$n]["name"])?></h2>
<p><?php echo htmlspecialchars($altfiles[$n]["description"])?></p>
</td>
<td><?php echo formatfilesize($altfiles[$n]["file_size"])?></td>
<?php if ($userrequestmode==2 || $userrequestmode==3) { ?><td></td><?php } # Blank spacer column if displaying a price above (basket mode).
?>
<?php if ($access==0){?>
<td class="DownloadButton">
<?php if (!$direct_download || $save_as){?>
<a <?php if (!hook("downloadlink","",array("ref=" . $ref . "&alternative=" . $altfiles[$n]["ref"] . "&k=" . $k . "&ext=" . $altfiles[$n]["file_extension"]))) { ?>href="<?php echo $baseurl_short?>pages/terms.php?ref=<?php echo urlencode($ref)?>&k=<?php echo urlencode($k)?>&search=<?php echo urlencode($search) ?>&url=<?php echo urlencode("pages/download_progress.php?ref=" . $ref . "&ext=" . $altfiles[$n]["file_extension"] . "&k=" . $k . "&alternative=" . $altfiles[$n]["ref"] . "&search=" . urlencode($search) . "&offset=" . $offset . "&archive=" . $archive . "&sort=".$sort."&order_by=" . urlencode($order_by))?>"<?php } ?> onClick="return CentralSpaceLoad(this,true);"><?php echo $lang["action-download"] ?></a>
<?php } else { ?>
<a href="#" onclick="directDownload('<?php echo $baseurl_short?>pages/download_progress.php?ref=<?php echo urlencode($ref)?>&ext=<?php echo $altfiles[$n]["file_extension"]?>&k=<?php echo urlencode($k)?>&alternative=<?php echo $altfiles[$n]["ref"]?>')"><?php echo $lang["action-download"]?></a>
<?php } // end if direct_download ?></td></td>
<?php } else { ?>
<td class="DownloadButton DownloadDisabled"><?php echo $lang["access1"]?></td>
<?php } ?>
</tr>
示例11: include
$search=getvalescaped("search","");
$offset=getvalescaped("offset","",true);
$order_by=getvalescaped("order_by","");
$archive=getvalescaped("archive","",true);
$restypes=getvalescaped("restypes","");
$starsearch=getvalescaped("starsearch","");
if (strpos($search,"!")!==false) {$restypes="";}
$default_sort="DESC";
if (substr($order_by,0,5)=="field"){$default_sort="ASC";}
$sort=getval("sort",$default_sort);
$results=do_search(getval("search",""),getvalescaped("restypes",""),"relevance",getval("archive",""),-1,"desc",false,$starsearch,false,true);
$disk_usage=$results[0]["total_disk_usage"];
$count=$results[0]["total_resources"];
include ("../include/header.php");
?>
<p><a onClick="return CentralSpaceLoad(this,true);" href="<?php echo $baseurl_short?>pages/search.php?search=<?php echo urlencode(getval("search","")) ?>&offset=<?php echo urlencode($offset)?>&order_by=<?php echo urlencode($order_by)?>&sort=<?php echo urlencode($sort)?>&archive=<?php echo urlencode($archive)?>&k=<?php echo urlencode($k)?>">< <?php echo $lang["back"] ?></a></p>
<h1><?php echo $lang["searchitemsdiskusage"] ?></h1>
<p><?php echo $lang["matchingresourceslabel"] . ": " . number_format($count) ?>
<br />
<?php echo $lang["diskusage"] . ": <strong>" . formatfilesize($disk_usage) . "</strong>" ?></p>
<?php
include ("../include/footer.php");
示例12: while
<thead><tr>
<th scope="col" width="150" style="border-width: 0px 0;color:#636363;font-size: 10pt; font-weight: bold; line-height:normal; text-align: left; border-bottom: 0.2em solid #09f;">Script:</th>
<th scope="col" width="125" style="border-width: 0px 0;color:#636363;font-size: 10pt; font-weight: bold; line-height:normal; text-align: left; border-bottom: 0.2em solid #09f;">Date:</th>
<th scope="col" width="100" style="border-width: 0px 0;color:#636363;font-size: 10pt; font-weight: bold; line-height:normal; text-align: left; border-bottom: 0.2em solid #09f;">Start:</th>
<th scope="col" width="100" style="border-width: 0px 0;color:#636363;font-size: 10pt; font-weight: bold; line-height:normal; text-align: left; border-bottom: 0.2em solid #09f;">End:</th>
<th scope="col" width="100" style="border-width: 0px 0;color:#636363;font-size: 10pt; font-weight: bold; line-height:normal; text-align: left; border-bottom: 0.2em solid #09f;">YQL Queries:</th>
<th scope="col" width="100" style="border-width: 0px 0;color:#636363;font-size: 10pt; font-weight: bold; line-height:normal; text-align: left; border-bottom: 0.2em solid #09f;">No Records:</th>
<th scope="col" width="450" style="border-width: 0px 0;color:#636363;font-size: 10pt; font-weight: bold; line-height:normal; text-align: left; border-bottom: 0.2em solid #09f;">Info:</th>
</tr>
</thead>
<tbody>';
while ($row = mysql_fetch_array($query, MYSQL_ASSOC)) {
$report .= '<tr>
<td style="text-align: left; vertical-align: bottom; white-space: nowrap; font: 10pt Verdana, Helvetica; border-spacing: 0; border-collapse: separate; margin: 0 0 0 0; color:#636363;">' . $row['script'] . '</td>
<td style="text-align: left; vertical-align: bottom; white-space: nowrap; font: 10pt Verdana, Helvetica; border-spacing: 0; border-collapse: separate; margin: 0 0 0 0; color:#636363;">' . $row['date'] . '</td>
<td style="text-align: left; vertical-align: bottom; white-space: nowrap; font: 10pt Verdana, Helvetica; border-spacing: 0; border-collapse: separate; margin: 0 0 0 0; color:#636363;">' . $row['start'] . '</td>
<td style="text-align: left; vertical-align: bottom; white-space: nowrap; font: 10pt Verdana, Helvetica; border-spacing: 0; border-collapse: separate; margin: 0 0 0 0; color:#636363;">' . $row['end'] . '</td>
<td style="text-align: left; vertical-align: bottom; white-space: nowrap; font: 10pt Verdana, Helvetica; border-spacing: 0; border-collapse: separate; margin: 0 0 0 0; color:#636363;">' . $row['yqlqty'] . '</td>
<td style="text-align: left; vertical-align: bottom; white-space: nowrap; font: 10pt Verdana, Helvetica; border-spacing: 0; border-collapse: separate; margin: 0 0 0 0; color:#636363;">' . $row['records'] . '</td>
<td style="text-align: left; vertical-align: bottom; white-space: nowrap; font: 10pt Verdana, Helvetica; border-spacing: 0; border-collapse: separate; margin: 0 0 0 0; color:#636363;">' . $row['info'] . '</td>
</tr>';
}
$report .= '</table><br><font style="text-align: left; vertical-align: bottom; white-space: nowrap; font: 10pt Verdana, Helvetica; border-spacing: 0; border-collapse: separate; margin: 0 0 0 0; color:#636363;">The size of the database is ' . formatfilesize($dbsize) . '</font></td></tr></table><br><br>' . $emailFooter . '</body></html>';
echo $report;
// Sent email with results:
if ($cronMailDailyReport > 0) {
$subject = 'Daily Database Activity Report';
$headers = 'From: ' . $fromEmail . '' . "\r\n" . 'Reply-To: no-reply@MyIchimoku.eu' . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
mail($adminEmail, $subject, $report, $headers);
}
mysql_close($conn);
示例13: getvalescaped
<?php
include "../../include/db.php";
include "../../include/general.php";
include "../../include/resource_functions.php";
$uniqid = getvalescaped("id", "");
$progress_file = get_temp_dir(false, $uniqid) . "/progress_file.txt";
if (!file_exists($progress_file)) {
touch($progress_file);
}
$content = file_get_contents($progress_file);
if ($content == "") {
echo $lang['preparingzip'];
} else {
if ($content == "zipping") {
$files = scandir(get_temp_dir(false, $uniqid));
foreach ($files as $file) {
if (strpos($file, "zip.zip") !== false) {
echo "zipping " . formatfilesize(filesize(get_temp_dir(false, $uniqid) . "/" . $file));
}
}
} else {
ob_start();
echo $content;
ob_flush();
exit;
}
}
// echo whatever the script has placed here.
示例14: getvalescaped
include "../../include/resource_functions.php";
$uniqid = getvalescaped("id", "");
$user = getvalescaped("user", "");
// Need to get this from query string since we haven't authenticated
$usertempdir = get_temp_dir(false, "rs_" . $user . "_" . $uniqid);
$progress_file = $usertempdir . "/progress_file.txt";
//$progress_file=get_temp_dir(false,$uniqid) . "/progress_file.txt";
if (!file_exists($progress_file)) {
touch($progress_file);
}
$content = file_get_contents($progress_file);
if ($content == "") {
echo $lang['preparingzip'];
} else {
if ($content == "zipping") {
$files = scandir($usertempdir);
echo "zipping";
foreach ($files as $file) {
//echo $file;
if (strpos($file, ".zip") !== false) {
echo formatfilesize(filesize($usertempdir . "/" . $file));
}
}
} else {
ob_start();
echo $content;
ob_flush();
exit;
}
}
// echo whatever the script has placed here.
示例15: formatfilesize
?>
</h1>
<h2><?php
echo $titleh2;
?>
</h2>
<div id="plupload_instructions"><p><?php
echo $intro;
?>
</p></div>
<?php
if (isset($plupload_max_file_size)) {
if (is_numeric($plupload_max_file_size)) {
$sizeText = formatfilesize($plupload_max_file_size);
} else {
$sizeText = formatfilesize(filesize2bytes($plupload_max_file_size));
}
echo ' ' . sprintf($lang['plupload-maxfilesize'], $sizeText);
}
hook("additionaluploadtext");
if ($allowed_extensions != "") {
$allowed_extensions = str_replace(", ", ",", $allowed_extensions);
$list = explode(",", trim($allowed_extensions));
sort($list);
$allowed_extensions = implode(",", $list);
?>
<p><?php
echo str_replace_formatted_placeholder("%extensions", str_replace(",", ", ", $allowed_extensions), $lang['allowedextensions-extensions']);
?>
</p><?php
}