当前位置: 首页>>代码示例>>PHP>>正文


PHP formatSize函数代码示例

本文整理汇总了PHP中formatSize函数的典型用法代码示例。如果您正苦于以下问题:PHP formatSize函数的具体用法?PHP formatSize怎么用?PHP formatSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了formatSize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testPerformance

 public function testPerformance()
 {
     $config['router.routing_table']['protocol'] = 'rewrite';
     // 初始化LtUrl
     $url = new LtUrl();
     $url->configHandle->addConfig($config);
     $url->init();
     // 初始化结束
     // 测试生成超链接
     $href = $url->generate('news', 'list', array('catid' => 4, 'page' => 10));
     $this->assertEquals('/news-list-catid-4-page-10.html', $href);
     /**
      * 运行 10,000 次,要求在1秒内运行完
      */
     $base_memory_usage = memory_get_usage();
     $times = 10000;
     $startTime = microtime(true);
     for ($i = 0; $i < $times; $i++) {
         $url->generate('news', 'list', array('catid' => 4, 'page' => 10));
     }
     $endTime = microtime(true);
     $totalTime = round($endTime - $startTime, 6);
     $averageTime = round($totalTime / $times, 6);
     $memory_usage = memory_get_usage() - $base_memory_usage;
     $averageMemory = formatSize($memory_usage / $times);
     $memory_usage = formatSize($memory_usage);
     if (LOTUS_UNITTEST_DEBUG) {
         echo "\n----------------------Url-----------------------------\n";
         echo "times      \t{$times}\n";
         echo "totalTime   \t{$totalTime}s\taverageTime   \t{$averageTime}s\n";
         echo "memoryUsage \t{$memory_usage}\taverageMemory \t{$averageMemory}";
         echo "\n---------------------------------------------------------\n";
     }
     $this->assertTrue(1 > $totalTime);
 }
开发者ID:jianghaiming0426,项目名称:lotusphp,代码行数:35,代码来源:PerformanceTuning.php

示例2: getPhotoFileSize

 /**
  * getPhotoFileSize 
  * 
  * @param string $file 
  * 
  * @return string
  */
 public function getPhotoFileSize($file)
 {
     $size = '0';
     if (file_exists($file)) {
         $size = filesize($file);
         $size = formatSize($size);
     }
     return $size;
 }
开发者ID:lmcro,项目名称:fcms,代码行数:16,代码来源:Destination.php

示例3: foreach

						<th>Note</th>
						<th>Derniere MaJ</th>
					</tr>
				</thead>
				<tbody>
					<?php 
foreach ($maps as $map) {
    echo '<tr>';
    if ($_SESSION['id'] && $_SESSION['level'] >= 2) {
        echo '<td><a href="map.php?id=' . $map['id'] . '">' . $map['name'] . '</a></td>';
    } else {
        echo '<td>' . $map['name'] . '</td>';
    }
    echo '<td>' . $map['file_rar'] . '</td>';
    echo '<td>' . formatSize($map['size_rar']) . '</td>';
    echo '<td>' . formatSize($map['size_vpk']) . '</td>';
    echo '<td>' . ($map['type'] ? $map['type'] : '--') . '</td>';
    if ($map['note'] >= 4) {
        echo '<td><span class="label label-success">' . $map['note'] . '</span></td>';
    } else {
        if ($map['note'] == 3) {
            echo '<td><span class="label label-warning">' . $map['note'] . '</span></td>';
        } else {
            if ($map['note'] >= 1) {
                echo '<td><span class="label label-important">' . $map['note'] . '</span></td>';
            } else {
                echo '<td>--</td>';
            }
        }
    }
    echo '<td>' . date('d/m/Y', $map['date']) . '</td>';
开发者ID:prototux,项目名称:old,代码行数:31,代码来源:maps.php

示例4: list_file

 function list_file($cur)
 {
     global $PHP_SELF, $order, $asc, $order0;
     if ($dir = opendir($cur)) {
         /* tableaux */
         $tab_dir = array();
         $tab_file = array();
         /* extraction */
         while ($file = readdir($dir)) {
             if (is_dir($cur . "/" . $file)) {
                 if (!in_array($file, array(".", ".."))) {
                     $tab_dir[] = addScheme($file, $cur, 'dir');
                 }
             } else {
                 $tab_file[] = addScheme($file, $cur, 'file');
             }
         }
         /* tri */
         // usort($tab_dir,"cmp_".$order);
         // usort($tab_file,"cmp_".$order);
         /* affichage */
         //*********************************************************************************************************
         echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
         echo "<tr style=\"font-size:8pt;font-family:arial;\">\n    <th>" . ($order == 'name' ? $asc == 'a' ? '/\\ ' : '\\/ ' : '') . "Nom</th><td>&nbsp;</td>\n    <th>" . ($order == 'size' ? $asc == 'a' ? '/\\ ' : '\\/ ' : '') . "Taille</th><td>&nbsp;</td>\n\t<th>" . ($order == 'date' ? $asc == 'a' ? '/\\ ' : '\\/ ' : '') . "Derniere modification</th><td>&nbsp;</td>\n\t</tr>";
         //*********************************************************************************************************
         foreach ($tab_file as $elem) {
             if ($_SESSION['privilege'] == 1) {
                 $cheminWeb = "#";
             } else {
                 $cheminWeb = "pages/force-download.php?file=" . INI_Conf_Moteur($_SESSION['opensim_select'], "address") . $elem['name'];
             }
             if (assocExt($elem['ext']) != 'inconnu') {
                 echo "<tr><td>";
                 echo '<FORM METHOD=POST ACTION=""><INPUT TYPE="submit" VALUE="Telecharger" NAME="cmd" ' . $btnN3 . '><INPUT TYPE="submit" VALUE="Supprimer" NAME="cmd" ' . $btnN3 . '><INPUT TYPE="hidden" VALUE="' . $_SESSION['opensim_select'] . '" NAME="name_sim"><INPUT TYPE="hidden" VALUE="' . $elem['name'] . '" NAME="name_file">&nbsp;&nbsp;&nbsp;' . $elem['name'] . '&nbsp;&nbsp;&nbsp;</FORM>';
                 echo "</td><td>&nbsp;</td>\n\t\t  <td align=\"right\">" . formatSize($elem['size']) . "</td><td>&nbsp;</td>\n\t\t  <td>" . date("d/m/Y H:i:s", $elem['date']) . "</td><td>&nbsp;</td></tr>";
             }
         }
         echo "</table>";
         closedir($dir);
         //*********************************************************************************************************
     }
 }
开发者ID:djphil,项目名称:osmw,代码行数:42,代码来源:GestBackup.php

示例5: time

        if (($_FILES["file"]["type"] == "image/gif" || $_FILES["file"]["type"] == "image/jpeg" || $_FILES["file"]["type"] == "image/jpg" || $_FILES["file"]["type"] == "image/pjpeg") && $_FILES["file"]["size"] < $max_size_picture) {
            if ($_FILES["file"]["error"] > 0) {
                echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
            } else {
                if (file_exists("phpThumb/images/" . $new_name)) {
                    echo '<img src="custom/SynoFieldPhoto/phpThumb/phpThumb.php?src=images/' . $new_name . '&h=150&w=150&t=' . time() . '">';
                } else {
                    if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
                        chmod($target_path, 0644);
                        //echo $target_path;
                        echo '<img src="custom/SynoFieldPhoto/phpThumb/phpThumb.php?src=images/' . $new_name . '&h=150&w=150&t=' . time() . '">';
                    }
                }
            }
        } elseif ($_FILES["file"]["size"] >= $max_size_picture) {
            echo "Error: File too big " . formatSize($_FILES["file"]["size"]) . ": " . formatSize($max_size_picture) . " Max <br />";
        } else {
            echo "Error: " . $_FILES["file"]["type"] . " not allowded <br />";
        }
    } else {
        echo 'Not allowed to Edit this ' . $class_name;
    }
}
function formatSize($size)
{
    switch (true) {
        case $size > 1099511627776:
            $size /= 1099511627776;
            $suffix = 'To';
            break;
        case $size > 1073741824:
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:31,代码来源:upload.php

示例6: elseif

        $bytes = $bytes . ' bytes';
    } elseif ($bytes == 1) {
        $bytes = $bytes . ' byte';
    } else {
        $bytes = '0 bytes';
    }
    return $bytes;
}
// Loop through array and print
for ($index = 0; $index < $indexCount; $index++) {
    // Declare variables for the current directory item
    $filename = $dirArray[$index];
    $filetype = filetype($dirArray[$index]);
    $size = filesize($dirArray[$index]);
    $modified = date("M j Y g:i A", filemtime($dirArray[$index]));
    $size = formatSize($size);
    // Split the filename at the "."
    list($name, $extension) = explode(".", $filename);
    // Switch block for file extension names
    switch ($extension) {
        case "png":
            $extension = "PNG Image";
            break;
        case "jpg":
            $extension = "JPEG Image";
            break;
        case "svg":
            $extension = "SVG Image";
            break;
        case "gif":
            $extension = "GIF Image";
开发者ID:andybeckmann,项目名称:directory_list,代码行数:31,代码来源:index.php

示例7: UCFirst

?>
</td>
                            </tr>
                            <tr>
                                <td class="descr">
                                    <?php 
echo UCFirst(t('maximum_file_upload_size', 'Maximum file upload size'));
?>
:
                                </td>
                                <td><?php 
echo SITE_CONFIG_FREE_USER_MAX_UPLOAD_FILESIZE > 0 ? formatSize(SITE_CONFIG_FREE_USER_MAX_UPLOAD_FILESIZE) : UCFirst(t('unlimited', 'unlimited'));
?>
</td>
                                <td><?php 
echo SITE_CONFIG_PREMIUM_USER_MAX_UPLOAD_FILESIZE > 0 ? formatSize(SITE_CONFIG_PREMIUM_USER_MAX_UPLOAD_FILESIZE) : UCFirst(t('unlimited', 'unlimited'));
?>
</td>
                            </tr>
                            <tr>
                                <td class="descr">
                                    <?php 
echo UCFirst(t('interface_to_manage_uploaded_files', 'interface to manage uploaded files'));
?>
:
                                </td>
                                <td><?php 
echo UCFirst(t('not_available', 'not available'));
?>
</td>
                                <td><?php 
开发者ID:farzam65,项目名称:YetiShare-File-Hosting-Script-Free,代码行数:31,代码来源:delayedRedirect.php

示例8: formatSize

$du3 = formatSize($du3);
$ftp3_t = formatSize($ftp3_t);
/* ----------------- FTP 3 --------------- */
/* ----------------- FTP 4 --------------- */
/* get disk space free (in bytes) */
$ftp4_f = disk_free_space("/var/www/html/directlink/FTP4");
/* and get disk space total (in bytes)  */
$ftp4_t = disk_total_space("/var/www/html/directlink/FTP4");
/* now we calculate the disk space used (in bytes) */
$du4 = $ftp4_t - $ftp4_f;
/* percentage of disk used - this will be used to also set the width % of the progress bar */
$dp4 = sprintf('%.2f', $du4 / $ftp4_t * 100);
/* and we formate the size from bytes to MB, GB, etc. */
$ftp4_f = formatSize($ftp4_f);
$du4 = formatSize($du4);
$ftp4_t = formatSize($ftp4_t);
/* ----------------- FTP 4 --------------- */
function formatSize($bytes)
{
    $types = array('B', 'KB', 'MB', 'GB', 'TB');
    for ($i = 0; $bytes >= 1024 && $i < count($types) - 1; $bytes /= 1024, $i++) {
    }
    return round($bytes, 2) . " " . $types[$i];
}
?>

<style type='text/css'>

body {
  background: #f3f3f3;
}
开发者ID:pavs,项目名称:disk-stats,代码行数:31,代码来源:index.php

示例9: showPhoto


//.........这里部分代码省略.........
                        document.location.href = "index.php?uid=' . $uid . '&cid=' . $urlcid . '&pid=' . $prev . '";
                        break;
                    }
                }
                document.onkeydown = keyHandler;
                </script>';
        }
        // special view detail
        $special = '
                <div id="special">
                    ' . T_('From the Category:') . ' <a href="?uid=' . $r['uid'] . '&amp;cid=' . $r['cid'] . '">' . cleanOutput($r['category_name']) . '</a> 
                    ' . T_('by') . ' 
                    <a class="u" href="../profile.php?member=' . $r['uid'] . '">' . $displayname . '</a>
                </div>';
        // if breadcrumbs haven't been defined, give the default
        if ($breadcrumbs == '') {
            $breadcrumbs = '
                <a href="?uid=0">' . T_('Members') . '</a> &gt; 
                <a href="?uid=' . $uid . '">' . $displayname . '</a> &gt; 
                <a href="?uid=' . $uid . '&amp;cid=' . $cid . '">' . cleanOutput($r['category_name']) . '</a>
                ' . $photos_of;
            $special = '';
        }
        // setup some vars to hold photo details
        if ($r['filename'] == 'noimage.gif' && $r['external_id'] != null) {
            $photo_path_middle = $r['medium'];
            $photo_path_full = $r['full'];
            $size = T_('Unknown');
        } else {
            $photo_path = $this->getPhotoPath($r['filename'], $r['uid']);
            $photo_path_middle = $photo_path[0];
            $photo_path_full = $photo_path[1];
            $size = filesize($photo_path_full);
            $size = formatSize($size);
        }
        $r['user'] = $r['uid'];
        // Figure out where we are currently saving photos, and create new destination object
        $photoDestinationType = getDestinationType() . 'PhotoGalleryDestination';
        $photoDestination = new $photoDestinationType($this->fcmsError, $this->fcmsUser);
        $mediumSrc = $this->getPhotoSource($r, 'medium');
        $fullSrc = $this->getPhotoSource($r, 'full');
        $caption = cleanOutput($r['caption']);
        $dimensions = $photoDestination->getImageSize($photo_path_full);
        $date_added = fixDate(T_('F j, Y g:i a'), $this->fcmsUser->tzOffset, $r['date']);
        // Calculate rating
        if ($r['votes'] <= 0) {
            $rating = 0;
            $width = 0;
        } else {
            $rating = $r['rating'] / $r['votes'] * 100;
            $rating = round($rating, 0);
            $width = $rating / 5;
        }
        // Get Tagged Members
        $sql = "SELECT u.`id`, u.`fname`, u.`lname` \n                FROM `fcms_users` AS u, `fcms_gallery_photos_tags` AS t \n                WHERE t.`photo` = '{$pid}' \n                AND t.`user` = u.`id`\n                ORDER BY u.`lname`";
        $rows = $this->fcmsDatabase->getRows($sql, $pid);
        if ($rows === false) {
            $this->fcmsError->displayError();
            return;
        }
        $tagged_mem_list = '<li>' . T_('none') . '</li>';
        if (count($rows) > 0) {
            $tagged_mem_list = '';
            foreach ($rows as $t) {
                $taggedName = cleanOutput($t['fname']) . ' ' . cleanOutput($t['lname']);
                $tagged_mem_list .= '<li><a href="?uid=0&cid=' . $t['id'] . '" ';
开发者ID:sauravpratihar,项目名称:fcms,代码行数:67,代码来源:gallery_class.php

示例10: strlen

		<div class="accountBenefit">
			Unlimited storage.
		</div>
	</div>
	<div class="accountBenefitWrapper">
		<div class="accountBenefit">
			Files kept for <?php 
echo strlen(SITE_CONFIG_PREMIUM_USER_UPLOAD_REMOVAL_DAYS) ? SITE_CONFIG_PREMIUM_USER_UPLOAD_REMOVAL_DAYS : 'unlimited';
?>
 days.
		</div>
	</div>
	<div class="accountBenefitWrapper">
		<div class="accountBenefit">
			Upload files up to <?php 
echo formatSize(SITE_CONFIG_PREMIUM_USER_MAX_UPLOAD_FILESIZE);
?>
 in size.
		</div>
	</div>
	<div class="accountBenefitWrapper">
		<div class="accountBenefit">
			No limits on the amount of downloads.
		</div>
	</div>
	<div class="accountBenefitWrapper">
		<div class="accountBenefit">
			Low price per day.
		</div>
	</div>
	<div class="accountBenefitWrapper">
开发者ID:farzam65,项目名称:YetiShare-File-Hosting-Script-Free,代码行数:31,代码来源:_upgradeBenefits.inc.php

示例11: bytes2str

function bytes2str($val, $round = 0)
{
    return formatSize($val);
}
开发者ID:farzam65,项目名称:YetiShare-File-Hosting-Script-Free,代码行数:4,代码来源:functions.inc.php

示例12: _e

			<tr valign="top">
				<th scope="row">
					<?php 
_e('browscap Cache File', 'wp_statistics');
?>
:
				</th>
				
				<td>
					<strong><?php 
$browscap_filename = $upload_dir['basedir'] . '/wp-statistics/cache.php';
$browscap_filedate = @filemtime($browscap_filename);
if ($browscap_filedate === FALSE) {
    _e('browscap cache file does not exist.', 'wp_statistics');
} else {
    echo formatSize(@filesize($browscap_filename)) . __(', created on ', 'wp_statistics') . date_i18n(get_option('date_format') . ' @ ' . get_option('time_format'), $browscap_filedate);
}
?>
</strong>
					<p class="description"><?php 
_e('The file size and date of the browscap cache file.', 'wp_statistics');
?>
</p>
				</td>
			</tr>
			
			<tr valign="top">
				<th scope="row" colspan="2"><h3><?php 
_e('Client Info', 'wp_statistics');
?>
</h3></th>
开发者ID:Ezyva2015,项目名称:money101.com.au,代码行数:31,代码来源:wps-optimization-resources.php

示例13: filesize

            echo "<p><a href=\"db_filedetails.php?SoundID={$SoundID}&amp;d={$d}&amp;hidekml={$hidekml}\">Show marks on spectrogram</a><br>";
        }
        echo "<a href=\"#\" onclick=\"window.open('db_filemarks.php?SoundID={$SoundID}', 'marks', 'width=600,height=550,status=yes,resizable=yes,scrollbars=auto')\">Show list of marks</a><br>";
    }
}
echo "\n\t\t\t\t\t<dl class=\"dl-horizontal\">\n\t\t\t\t\t\t<dt>Original filename</dt>\n\t\t\t\t\t\t<dd>{$OriginalFilename}</dd>";
#Check if the file size is in the database
if ($FileSize == NULL || $FileSize == 0) {
    $file_filesize = filesize("sounds/sounds/{$ColID}/{$DirID}/{$OriginalFilename}");
    #$result_size = mysqli_query($connection, "UPDATE Sounds SET FileSize='$file_filesize' WHERE SoundID='$SoundID' LIMIT 1")
    #	or die (mysqli_error($connection));
    $this_array = array('FileSize' => $file_filesize);
    DB::update('Sounds', $this_array, $SoundID, 'SoundID');
    $FileSize = formatSize($file_filesize);
} else {
    $FileSize = formatSize($FileSize);
}
echo "<dt>File Format</dt><dd>{$SoundFormat}</dd>\n\t\t\t\t\t\t<dt>Sampling rate</dt><dd>{$SamplingRate} Hz</dd>\n\t\t\t\t\t\t<dt>Number of channels</dt><dd>{$Channels}</dd>";
echo "\n\t\t\t\t\t\t<dt>File size</dt>\n\t\t\t\t\t\t<dd>{$FileSize}</dd>";
if ($Duration > 60) {
    $formated_Duration = formatTime(round($Duration));
    echo "<dt>Duration</dt><dd>{$formated_Duration} (hh:mm:ss)</dd>";
} else {
    echo "<dt>Duration</dt><dd>{$Duration} seconds</dd>";
}
#Check if from a sample set
if ($pumilio_loggedin) {
    $sample_check = mysqli_query($connection, "SELECT Samples.SampleName,Samples.SampleID FROM\n\t\t\t\t\t\t\tSamples,SampleMembers WHERE Samples.SampleID=SampleMembers.SampleID \n\t\t\t\t\t\t\tAND SampleMembers.SoundID='{$SoundID}'") or die(mysqli_error($connection));
    $check_nrows = mysqli_num_rows($sample_check);
    if ($check_nrows > 0) {
        $check_row = mysqli_fetch_array($sample_check);
开发者ID:nperezg,项目名称:pumilio,代码行数:31,代码来源:db_filedetails.php

示例14: html_start


//.........这里部分代码省略.........
        if ($mta == 'postfix' && $_SESSION['user_type'] == 'A') {
            if (is_readable($incomingdir) && is_readable($outgoingdir)) {
                $inq = postfixinq();
                $outq = postfixallq() - $inq;
                echo '    <tr><td colspan="3" class="heading" align="center">Mail Queues</td></tr>' . "\n";
                echo '    <tr><td colspan="2"><a href="postfixmailq.php">Inbound:</a></td><td align="right">' . $inq . '</td>' . "\n";
                echo '    <tr><td colspan="2"><a href="postfixmailq.php">Outbound:</a></td><td align="right">' . $outq . '</td>' . "\n";
            } else {
                echo '    <tr><td colspan="3">Please verify read permissions on ' . $incomingdir . ' and ' . $outgoingdir . '</td></tr>' . "\n";
            }
            // else use mailq which is for sendmail and exim
        } elseif (MAILQ && $_SESSION['user_type'] == 'A') {
            $inq = mysql_result(dbquery("SELECT COUNT(*) FROM inq WHERE " . $_SESSION['global_filter']), 0);
            $outq = mysql_result(dbquery("SELECT COUNT(*) FROM outq WHERE " . $_SESSION['global_filter']), 0);
            echo '    <tr><td colspan="3" class="heading" align="center">Mail Queues</td></tr>' . "\n";
            echo '    <tr><td colspan="2"><a href="mailq.php?queue=inq">Inbound:</a></td><td align="right">' . $inq . '</td>' . "\n";
            echo '    <tr><td colspan="2"><a href="mailq.php?queue=outq">Outbound:</a></td><td align="right">' . $outq . '</td>' . "\n";
        }
        // drive display
        if ($_SESSION['user_type'] == 'A') {
            echo '    <tr><td colspan="3" class="heading" align="center">' . __('freedspace03') . '</td></tr>' . "\n";
            foreach (get_disks() as $disk) {
                $free_space = disk_free_space($disk['mountpoint']);
                $total_space = disk_total_space($disk['mountpoint']);
                if (round($free_space / $total_space, 2) <= 0.1) {
                    $percent = '<span style="color:red">';
                } else {
                    $percent = '<span>';
                }
                $percent .= ' [';
                $percent .= round($free_space / $total_space, 2) * 100;
                $percent .= '%] ';
                $percent .= '</span>';
                echo '    <tr><td>' . $disk['mountpoint'] . '</td><td colspan="2" align="right">' . formatSize($free_space) . $percent . '</td>' . "\n";
            }
        }
        echo '  </table>' . "\n";
        echo '  </td>' . "\n";
    }
    echo '<td align="center" valign="top">' . "\n";
    $sql = "\n SELECT\n  COUNT(*) AS processed,\n  SUM(\n   CASE WHEN (\n    (virusinfected=0 OR virusinfected IS NULL)\n    AND (nameinfected=0 OR nameinfected IS NULL)\n    AND (otherinfected=0 OR otherinfected IS NULL)\n    AND (isspam=0 OR isspam IS NULL)\n    AND (ishighspam=0 OR ishighspam IS NULL)\n    AND (ismcp=0 OR ismcp IS NULL)\n    AND (ishighmcp=0 OR ishighmcp IS NULL)\n   ) THEN 1 ELSE 0 END\n  ) AS clean,\n  ROUND((\n   SUM(\n    CASE WHEN (\n     (virusinfected=0 OR virusinfected IS NULL)\n     AND (nameinfected=0 OR nameinfected IS NULL)\n     AND (otherinfected=0 OR otherinfected IS NULL)\n     AND (isspam=0 OR isspam IS NULL)\n     AND (ishighspam=0 OR ishighspam IS NULL)\n     AND (ismcp=0 OR ismcp IS NULL)\n     AND (ishighmcp=0 OR ishighmcp IS NULL)\n    ) THEN 1 ELSE 0 END\n   )/COUNT(*))*100,1\n  ) AS cleanpercent,\n  SUM(\n   CASE WHEN\n    virusinfected>0\n   THEN 1 ELSE 0 END\n  ) AS viruses,\n  ROUND((\n   SUM(\n    CASE WHEN\n     virusinfected>0\n    THEN 1 ELSE 0 END\n   )/COUNT(*))*100,1\n  ) AS viruspercent,\n  SUM(\n   CASE WHEN\n    nameinfected>0\n    AND (virusinfected=0 OR virusinfected IS NULL)\n    AND (otherinfected=0 OR otherinfected IS NULL)\n    AND (isspam=0 OR isspam IS NULL)\n    AND (ishighspam=0 OR ishighspam IS NULL)\n   THEN 1 ELSE 0 END\n  ) AS blockedfiles,\n  ROUND((\n   SUM(\n    CASE WHEN\n     nameinfected>0\n     AND (virusinfected=0 OR virusinfected IS NULL)\n     AND (otherinfected=0 OR otherinfected IS NULL)\n     AND (isspam=0 OR isspam IS NULL)\n     AND (ishighspam=0 OR ishighspam IS NULL)\n    THEN 1 ELSE 0 END\n   )/COUNT(*))*100,1\n  ) AS blockedfilespercent,\n  SUM(\n   CASE WHEN\n    otherinfected>0\n    AND (nameinfected=0 OR nameinfected IS NULL)\n    AND (virusinfected=0 OR virusinfected IS NULL)\n    AND (isspam=0 OR isspam IS NULL)\n    AND (ishighspam=0 OR ishighspam IS NULL)\n   THEN 1 ELSE 0 END\n  ) AS otherinfected,\n  ROUND((\n   SUM(\n    CASE WHEN\n     otherinfected>0\n     AND (nameinfected=0 OR nameinfected IS NULL)\n     AND (virusinfected=0 OR virusinfected IS NULL)\n     AND (isspam=0 OR isspam IS NULL)\n     AND (ishighspam=0 OR ishighspam IS NULL)\n    THEN 1 ELSE 0 END\n   )/COUNT(*))*100,1\n  ) AS otherinfectedpercent,\n  SUM(\n   CASE WHEN\n    isspam>0\n    AND (virusinfected=0 OR virusinfected IS NULL)\n    AND (nameinfected=0 OR nameinfected IS NULL)\n    AND (otherinfected=0 OR otherinfected IS NULL)\n    AND (ishighspam=0 OR ishighspam IS NULL)\n   THEN 1 ELSE 0 END\n  ) AS spam,\n  ROUND((\n   SUM(\n    CASE WHEN\n     isspam>0\n     AND (virusinfected=0 OR virusinfected IS NULL)\n     AND (nameinfected=0 OR nameinfected IS NULL)\n     AND (otherinfected=0 OR otherinfected IS NULL)\n     AND (ishighspam=0 OR ishighspam IS NULL)\n    THEN 1 ELSE 0 END\n   )/COUNT(*))*100,1\n  ) AS spampercent,\n  SUM(\n   CASE WHEN\n    ishighspam>0\n    AND (virusinfected=0 OR virusinfected IS NULL)\n    AND (nameinfected=0 OR nameinfected IS NULL)\n    AND (otherinfected=0 OR otherinfected IS NULL)\n   THEN 1 ELSE 0 END\n  ) AS highspam,\n  ROUND((\n   SUM(\n    CASE WHEN\n     ishighspam>0\n     AND (virusinfected=0 OR virusinfected IS NULL)\n     AND (nameinfected=0 OR nameinfected IS NULL)\n     AND (otherinfected=0 OR otherinfected IS NULL)\n    THEN 1 ELSE 0 END\n   )/COUNT(*))*100,1\n  ) AS highspampercent,\n  SUM(\n   CASE WHEN\n    ismcp>0\n    AND (virusinfected=0 OR virusinfected IS NULL)\n    AND (nameinfected=0 OR nameinfected IS NULL)\n    AND (otherinfected=0 OR otherinfected IS NULL)\n    AND (isspam=0 OR isspam IS NULL)\n    AND (ishighspam=0 OR ishighspam IS NULL)\n    AND (ishighmcp=0 OR ishighmcp IS NULL)\n   THEN 1 ELSE 0 END\n  ) AS mcp,\n  ROUND((\n   SUM(\n    CASE WHEN\n     ismcp>0\n     AND (virusinfected=0 OR virusinfected IS NULL)\n     AND (nameinfected=0 OR nameinfected IS NULL)\n     AND (otherinfected=0 OR otherinfected IS NULL)\n     AND (isspam=0 OR isspam IS NULL)\n     AND (ishighspam=0 OR ishighspam IS NULL)\n     AND (ishighmcp=0 OR ishighmcp IS NULL)\n    THEN 1 ELSE 0 END\n   )/COUNT(*))*100,1\n  ) AS mcppercent,\n  SUM(\n   CASE WHEN\n    ishighmcp>0\n    AND (virusinfected=0 OR virusinfected IS NULL)\n    AND (nameinfected=0 OR nameinfected IS NULL)\n    AND (otherinfected=0 OR otherinfected IS NULL)\n    AND (isspam=0 OR isspam IS NULL)\n    AND (ishighspam=0 OR ishighspam IS NULL)\n   THEN 1 ELSE 0 END\n  ) AS highmcp,\n  ROUND((\n   SUM(\n    CASE WHEN\n     ishighmcp>0\n     AND (virusinfected=0 OR virusinfected IS NULL)\n     AND (nameinfected=0 OR nameinfected IS NULL)\n     AND (otherinfected=0 OR otherinfected IS NULL)\n     AND (isspam=0 OR isspam IS NULL)\n     AND (ishighspam=0 OR ishighspam IS NULL)\n    THEN 1 ELSE 0 END\n   )/COUNT(*))*100,1\n  ) AS highmcppercent,\n  SUM(size) AS size\n FROM\n  maillog\n WHERE\n  date = CURRENT_DATE()\n AND\n  " . $_SESSION['global_filter'] . "\n";
    $sth = dbquery($sql);
    while ($row = mysql_fetch_object($sth)) {
        echo '<table border="0" cellpadding="1" cellspacing="1" class="mail" width="200">' . "\n";
        echo ' <tr><th align="center" colspan="3">' . __('todaystotals03') . '</th></tr>' . "\n";
        echo ' <tr><td>' . __('processed03') . ':</td><td align="right">' . number_format($row->processed) . '</td><td align="right">' . format_mail_size($row->size) . '</td></tr>' . "\n";
        echo ' <tr><td>' . __('cleans03') . ':</td><td align="right">' . number_format($row->clean) . '</td><td align="right">' . $row->cleanpercent . '%</td></tr>' . "\n";
        echo ' <tr><td>' . __('viruses03') . ':</td><td align="right">' . number_format($row->viruses) . '</td><td align="right">' . $row->viruspercent . '%</tr>' . "\n";
        echo ' <tr><td>Top Virus:</td><td colspan="2" align="right" style="white-space:nowrap">' . return_todays_top_virus() . '</td></tr>' . "\n";
        echo ' <tr><td>' . __('blockedfiles03') . ':</td><td align="right">' . number_format($row->blockedfiles) . '</td><td align="right">' . $row->blockedfilespercent . '%</td></tr>' . "\n";
        echo ' <tr><td>' . __('others03') . ':</td><td align="right">' . number_format($row->otherinfected) . '</td><td align="right">' . $row->otherinfectedpercent . '%</td></tr>' . "\n";
        echo ' <tr><td>Spam:</td><td align="right">' . number_format($row->spam) . '</td><td align="right">' . $row->spampercent . '%</td></tr>' . "\n";
        echo ' <tr><td style="white-space:nowrap">' . __('hscospam03') . ':</td><td align="right">' . number_format($row->highspam) . '</td><td align="right">' . $row->highspampercent . '%</td></tr>' . "\n";
        if (get_conf_truefalse('mcpchecks')) {
            echo ' <tr><td>MCP:</td><td align="right">' . number_format($row->mcp) . '</td><td align="right">' . $row->mcppercent . '%</td></tr>' . "\n";
            echo ' <tr><td style="white-space:nowrap">' . __('hscomcp03') . ':</td><td align="right">' . number_format($row->highmcp) . '</td><td align="right">' . $row->highmcppercent . '%</td></tr>' . "\n";
        }
        echo '</table>' . "\n";
    }
    // Navigation links - put them into an array to allow them to be switched
    // on or off as necessary and to allow for the table widths to be calculated.
    $nav = array();
    $nav['status.php'] = __('recentmessages03');
    if (LISTS) {
        $nav['lists.php'] = __('lists03');
    }
开发者ID:thctlo,项目名称:1.2.0,代码行数:67,代码来源:functions.php

示例15: recaptcha_get_html

                        <tbody>
                            <tr>
                                <td>
                                    <div style="padding: 14px;">
                                        <div style="float: right;">
                                            <?php 
echo recaptcha_get_html(SITE_CONFIG_CAPTCHA_PUBLIC_KEY);
?>
                                            <div class="clear"><!-- --></div>
                                        </div>
                                        <div style="text-align:left;">
                                            <strong><?php 
echo $file->originalFilename;
?>
 (<?php 
echo formatSize($file->fileSize);
?>
)</strong>
                                        </div>
                                        <div style="font-size: 12px; text-align:left; padding-top: 14px;">
                                            <?php 
echo t("in_order_to_prevent_abuse_captcha_intro", "In order to prevent abuse of this service, please copy the words into the text box on the right.");
?>
                                        </div>
                                        <div style="font-size: 12px; text-align:left; padding-top: 14px;">
                                            <input name="submit" type="submit" value="<?php 
echo t('continue', 'continue');
?>
" class="submitInput"/>
                                            <input type="hidden" name="submitted" value="1"/>
                                            <input type="hidden" name="d" value="1"/>
开发者ID:farzam65,项目名称:YetiShare-File-Hosting-Script-Free,代码行数:31,代码来源:fileDownloadCaptcha.inc.php


注:本文中的formatSize函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。