本文整理汇总了PHP中files::parseSizeSmart方法的典型用法代码示例。如果您正苦于以下问题:PHP files::parseSizeSmart方法的具体用法?PHP files::parseSizeSmart怎么用?PHP files::parseSizeSmart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类files
的用法示例。
在下文中一共展示了files::parseSizeSmart方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setup
function setup()
{
db::table('pages_content');
db::where('page_id', PAGE_ID);
db::where('content_pub', '1');
db::order('content_id');
$res = db::select('content');
$i = 0;
if ($res) {
while ($row = mysql_fetch_assoc($res)) {
$i++;
s::set('page_content' . $i, $row['content']);
}
}
db::table('pages_files');
db::where('page_id', PAGE_ID);
$r = db::select();
if (db::rows() != 0) {
s::section('page_files_show');
}
while ($a = mysql_fetch_assoc($r)) {
$a['file_icon'] = files::getFileIco($a['file_type']);
$a['file_size'] = files::parseSizeSmart($a['file_size']);
s::roll('page_files', $a);
}
}
示例2: show
function show()
{
$event = web::getEvent();
if ($event === false) {
$year = date('Y');
} else {
$year = $event;
}
s::set('info_date_select', htmlspecialchars($year));
$sql = "SELECT `section_year` as date FROM `info_sections` WHERE `section_view`='0' GROUP BY `date` ORDER BY `date` DESC";
$res = db::query($sql);
$rows = mysql_num_rows($res);
if ($rows > 1) {
s::add('info_date_selector', '<ul class="years">');
while ($row = mysql_fetch_assoc($res)) {
if ($row['date'] == $year) {
$row['date'] = '<li><span>' . $row['date'] . '</span></li>';
} else {
$row['date'] = '<li><a href="' . web::get('page_folder') . '' . $row['date'] . '/">' . $row['date'] . '</a></li>';
}
s::add('info_date_selector', $row['date']);
}
s::add('info_date_selector', '</ul>');
}
$files = array();
db::table('info_files');
$r = db::select();
while ($a = mysql_fetch_assoc($r)) {
$files[$a['section_id']][] = $a;
}
db::table('info_sections');
db::order('section_order', 'DESC');
db::where('section_year', $year);
$r = db::select();
if (db::rows() == 0) {
web::error404();
}
while ($a = mysql_fetch_assoc($r)) {
if ($a['section_view'] == '0') {
s::roll('sections', $a);
} else {
s::roll('sections_view', $a);
}
if (isset($files[$a['section_id']])) {
foreach ($files[$a['section_id']] as $v) {
$v['file_icon'] = files::getFileIco($v['file_type']);
$v['file_size'] = files::parseSizeSmart($v['file_size']);
s::roll('items' . $a['section_id'], $v);
}
}
}
}
示例3: showCard
function showCard($item_id, $section_id)
{
$dir_path = IMAGES_PATH . 'items/';
db::table('catalog_items');
db::where('item_id', $item_id);
$item = db::assoc();
if (db::rows() == 0) {
web::error404();
}
db::table('catalog_sections');
db::where('section_id', $section_id);
$section = db::assoc();
s::set('page_title', $item['item_name']);
s::set('page_header', $item['item_name']);
s::set('add_path', '<a href="/catalog/' . $section['section_id'] . '/">' . $section['section_name'] . '</a> <span>→</span>');
s::set($item);
db::table('catalog_items_photos');
db::where('item_id', $item_id);
$r = db::select();
if (db::rows() > 1) {
s::section('item_photos_show');
}
$i = 0;
while ($a = mysql_fetch_assoc($r)) {
$i++;
if ($i == 1) {
$a['act'] = 'act';
s::set('big_pic', '<img src="' . $dir_path . $a['file_id'] . '.jpg' . '" width="268" alt="" />');
}
$a['file_path'] = $dir_path . $a['file_id'] . '_m.jpg';
s::roll('item_photos', $a);
}
db::table('catalog_items_files');
db::where('item_id', $item_id);
$r = db::select();
if (db::rows() != 0) {
s::section('item_files_show');
}
while ($a = mysql_fetch_assoc($r)) {
$a['file_icon'] = files::getFileIco($a['file_type']);
$a['file_size'] = files::parseSizeSmart($a['file_size']);
s::roll('item_files', $a);
}
db::table('catalog_items_parts');
db::where('item_id', $item_id);
db::order('part_id');
$r = db::select();
if (db::rows() > 1) {
s::section('item_parts_show');
}
$i = 0;
while ($a = mysql_fetch_assoc($r)) {
s::roll('parts', $a);
}
}