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


PHP MediaHelper::parseSize方法代码示例

本文整理汇总了PHP中MediaHelper::parseSize方法的典型用法代码示例。如果您正苦于以下问题:PHP MediaHelper::parseSize方法的具体用法?PHP MediaHelper::parseSize怎么用?PHP MediaHelper::parseSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MediaHelper的用法示例。


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

示例1: defined

 * @subpackage	com_media
 * @copyright	Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */
// No direct access.
defined('_JEXEC') or die;
$params = new JRegistry();
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_img, &$params));
?>
		<div class="item">
			<a href="javascript:ImageManager.populateFields('<?php 
echo $this->_tmp_img->path_relative;
?>
')" title="<?php 
echo $this->_tmp_img->name;
?>
" >
				<?php 
echo JHtml::_('image', $this->baseURL . '/' . $this->_tmp_img->path_relative, JText::sprintf('COM_MEDIA_IMAGE_TITLE', $this->_tmp_img->title, MediaHelper::parseSize($this->_tmp_img->size)), array('width' => $this->_tmp_img->width_60, 'height' => $this->_tmp_img->height_60));
?>
				<span title="<?php 
echo $this->_tmp_img->name;
?>
"><?php 
echo $this->_tmp_img->title;
?>
</span></a>
		</div>
<?php 
$dispatcher->trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_img, &$params));
开发者ID:acculitx,项目名称:fleetmatrixsite,代码行数:31,代码来源:default_image.php

示例2: defined

 */
// No direct access.
defined('_JEXEC') or die;
?>
		<div class="item">
			<a href="javascript:ImageManager.populateFields('<?php 
echo $this->_tmp_img->path_relative;
?>
')">
				<img src="<?php 
echo $this->baseURL . '/' . $this->_tmp_img->path_relative;
?>
"  width="<?php 
echo $this->_tmp_img->width_60;
?>
" height="<?php 
echo $this->_tmp_img->height_60;
?>
" alt="<?php 
echo $this->_tmp_img->name;
?>
 - <?php 
echo MediaHelper::parseSize($this->_tmp_img->size);
?>
" />
				<span><?php 
echo $this->_tmp_img->name;
?>
</span></a>
		</div>
开发者ID:joebushi,项目名称:joomla,代码行数:30,代码来源:default_image.php

示例3: getList

 function getList()
 {
     static $list;
     // Only process the list once per request
     if (is_array($list)) {
         return $list;
     }
     // Get current path from request
     $current = $this->getState('folder');
     // If undefined, set to empty
     if ($current == 'undefined') {
         $current = '';
     }
     // Initialize variables
     if (strlen($current) > 0) {
         $basePath = Citruscart::getPath('images') . DS . $current;
     } else {
         $basePath = Citruscart::getPath('images');
     }
     $mediaBase = str_replace(DS, '/', Citruscart::getPath('images') . '/');
     $images = array();
     $folders = array();
     $docs = array();
     // Get the list of files and folders from the given folder
     $fileList = JFolder::files($basePath);
     $folderList = JFolder::folders($basePath);
     // Iterate over the files if they exist
     if ($fileList !== false) {
         foreach ($fileList as $file) {
             if (is_file($basePath . DS . $file) && substr($file, 0, 1) != '.' && strtolower($file) !== 'index.html') {
                 $tmp = new JObject();
                 $tmp->name = $file;
                 $tmp->path = str_replace(DS, '/', JPath::clean($basePath . DS . $file));
                 $tmp->path_relative = str_replace($mediaBase, '', $tmp->path);
                 $tmp->size = filesize($tmp->path);
                 $ext = strtolower(JFile::getExt($file));
                 switch ($ext) {
                     // Image
                     case 'jpg':
                     case 'png':
                     case 'gif':
                     case 'xcf':
                     case 'odg':
                     case 'bmp':
                     case 'jpeg':
                         $info = getimagesize($tmp->path);
                         $tmp->width = $info[0];
                         $tmp->height = $info[1];
                         $tmp->type = $info[2];
                         $tmp->mime = $info['mime'];
                         $filesize = MediaHelper::parseSize($tmp->size);
                         if ($info[0] > 60 || $info[1] > 60) {
                             $dimensions = MediaHelper::imageResize($info[0], $info[1], 60);
                             $tmp->width_60 = $dimensions[0];
                             $tmp->height_60 = $dimensions[1];
                         } else {
                             $tmp->width_60 = $tmp->width;
                             $tmp->height_60 = $tmp->height;
                         }
                         if ($info[0] > 16 || $info[1] > 16) {
                             $dimensions = MediaHelper::imageResize($info[0], $info[1], 16);
                             $tmp->width_16 = $dimensions[0];
                             $tmp->height_16 = $dimensions[1];
                         } else {
                             $tmp->width_16 = $tmp->width;
                             $tmp->height_16 = $tmp->height;
                         }
                         $images[] = $tmp;
                         break;
                         // Non-image document
                     // Non-image document
                     default:
                         $iconfile_32 = JPATH_ADMINISTRATOR . "/components/com_media/images/mime-icon-32/" . $ext . ".png";
                         if (file_exists($iconfile_32)) {
                             $tmp->icon_32 = "components/com_media/images/mime-icon-32/" . $ext . ".png";
                         } else {
                             $tmp->icon_32 = "components/com_media/images/con_info.png";
                         }
                         $iconfile_16 = JPATH_ADMINISTRATOR . "/components/com_media/images/mime-icon-16/" . $ext . ".png";
                         if (file_exists($iconfile_16)) {
                             $tmp->icon_16 = "components/com_media/images/mime-icon-16/" . $ext . ".png";
                         } else {
                             $tmp->icon_16 = "components/com_media/images/con_info.png";
                         }
                         $docs[] = $tmp;
                         break;
                 }
             }
         }
     }
     // Iterate over the folders if they exist
     if ($folderList !== false) {
         foreach ($folderList as $folder) {
             $tmp = new JObject();
             $tmp->name = basename($folder);
             $tmp->path = str_replace(DS, '/', JPath::clean($basePath . DS . $folder));
             $tmp->path_relative = str_replace($mediaBase, '', $tmp->path);
             $count = MediaHelper::countFiles($tmp->path);
             $tmp->files = $count[0];
             $tmp->folders = $count[1];
//.........这里部分代码省略.........
开发者ID:joomlacorner,项目名称:citruscart,代码行数:101,代码来源:elementimage.php

示例4:

?>
		<div class="imgOutline">
			<div class="imgTotal">
				<div class="imgBorder center">
					<a class="img-preview" href="<?php 
echo COM_MEDIA_BASEURL . '/' . $this->_tmp_img->path_relative;
?>
" title="<?php 
echo $this->_tmp_img->name;
?>
" style="display: block; width: 100%; height: 100%">
						<img src="<?php 
echo COM_MEDIA_BASEURL . '/' . $this->_tmp_img->path_relative;
?>
" alt="<?php 
echo Lang::txt('COM_MEDIA_IMAGE_TITLE', $this->_tmp_img->title, MediaHelper::parseSize($this->_tmp_img->size));
?>
" width="<?php 
echo $this->_tmp_img->width_60;
?>
" height="<?php 
echo $this->_tmp_img->height_60;
?>
" />
					</a>
				</div>
			</div>
			<div class="controls">
			<?php 
if (User::authorise('core.delete', 'com_media')) {
    ?>
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:31,代码来源:thumbs_img.php

示例5:

')">
		<img
		src="<?php 
echo $this->baseURL . '/' . $this->_tmp_img->path_relative;
?>
"
		class="jsn-graphic-showcase"
		width="<?php 
echo $this->_tmp_img->width_60;
?>
"
		height="<?php 
echo $this->_tmp_img->height_60;
?>
"
		alt="<?php 
echo $this->_tmp_img->name;
?>
 - <?php 
echo $objPlgMediaHelper->parseSize($this->_tmp_img->size);
?>
" />
		<span> <?php 
echo $this->_tmp_img->name;
?>
 <br /> <?php 
echo $this->_tmp_img->width . 'x' . $this->_tmp_img->height;
?>
	</span> </a>
</div>
开发者ID:NallelyFlores89,项目名称:basvec,代码行数:30,代码来源:default_image.php


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