@Ghazascanner
_2019runbot
Ghazascanner File Manager
server :Linux phosweb012 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
Current Path :
/
homepage
/
v-mt
/
php
/
lib
/
Path :
Upload File :
New :
File
Dir
//homepage/v-mt/php/lib/function.mtassetproperty.php
<?php # Movable Type (r) (C) 2001-2008 Six Apart, Ltd. All Rights Reserved. # This code cannot be redistributed without permission from www.sixapart.com. # For more information, consult your Movable Type license. # # $Id$ require_once("function.mtassetfilepath.php"); function smarty_function_mtassetproperty($args, &$ctx) { $asset = $ctx->stash('asset'); if (!$asset) return ''; if (!isset($args['property'])) return ''; if ($args['property'] == 'file_size') { $asset_file = smarty_function_mtassetfilepath($args, $ctx); $filesize = filesize($asset_file); $format = '1'; if (isset($args['format'])) $format = $args['format']; if ($format == '1') { if ($filesize < 1024) $filesize = sprintf("%d Bytes", $filesize); elseif ($filesize < 1048576) $filesize = sprintf("%.1f KB", $filesize / 1024); else $filesize = sprintf("%.1f MB", $filesize / 1048576); } elseif ($format == 'k') { $filesize = sprintf("%.1f", $filesize / 1024); } elseif ($format == 'm') { $filesize = sprintf("%.1f", $filesize / 1048576); } return $filesize; } elseif (($args['property'] == 'image_width') || ($args['property'] == 'image_height')) { if ($asset['asset_class'] == 'image') return $asset['asset_'.$args['property']]; else return 0; } else { if (!isset($asset['asset_'.$args['property']])) return ''; return $asset['asset_'.$args['property']]; } } ?>