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


PHP KunenaAttachmentHelper::shortenFileName方法代码示例

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


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

示例1: getShortName

 /**
  * This function shortens long filenames for display purposes.
  *
  * The first 8 characters of the filename, followed by three dots and the last 5 character of the filename.
  *
  * @param int    $front
  * @param int    $back
  * @param string $filler
  * @param bool   $escape
  *
  * @return string
  *
  * @since  K4.0
  */
 public function getShortName($front = 10, $back = 8, $filler = '...', $escape = true)
 {
     if ($this->shortname === null) {
         $this->shortname = KunenaAttachmentHelper::shortenFileName($this->getFilename(false), $front, $back, $filler);
     }
     return $escape ? htmlspecialchars($this->shortname, ENT_COMPAT, 'UTF-8') : $this->shortname;
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:21,代码来源:attachment.php

示例2: defined

<?php
/**
 * Kunena Component
 *
 * @package     Kunena.Template.Crypsis
 * @subpackage  BBCode
 *
 * @copyright   (C) 2008 - 2016 Kunena Team. All rights reserved.
 * @license     http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link        https://www.kunena.org
 **/
defined('_JEXEC') or die ();

/** @var KunenaAttachment $attachment */
$attachment = $this->attachment;

$config = KunenaConfig::getInstance();

$attributesLink = $attachment->isImage() && $config->lightbox ? ' class="fancybox-button" rel="fancybox-button"' : '';
?>

<a class="btn btn-small" rel="popover" data-placement="bottom" data-trigger="hover" target="_blank" data-content="Filesize: <?php echo number_format($attachment->size / 1024, 0, '', ',') . JText::_('COM_KUNENA_USER_ATTACHMENT_FILE_WEIGHT'); ?>
" data-original-title="<?php echo $attachment->getShortName(); ?>" href="<?php echo $attachment->getUrl(); ?>" title="<?php echo KunenaAttachmentHelper::shortenFileName($attachment->getFilename(), 0, 26); ?>">
	<i class="icon icon-info"></i>
</a>
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:25,代码来源:textlink.php

示例3: defined

 *
 * @package     Kunena.Template.Crypsis
 * @subpackage  BBCode
 *
 * @copyright   (C) 2008 - 2015 Kunena Team. All rights reserved.
 * @license     http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link        http://www.kunena.org
 **/
defined('_JEXEC') or die;
/** @var KunenaAttachment $attachment */
$attachment = $this->attachment;
$config = KunenaConfig::getInstance();
$attributesLink = $attachment->isImage() && $config->lightbox ? ' class="fancybox-button" rel="fancybox-button"' : '';
?>

<a class="btn btn-small" rel="popover" data-placement="bottom" data-trigger="hover" data-content="Filesize: <?php 
echo number_format($attachment->size / 1024, 0, '', ',') . JText::_('COM_KUNENA_USER_ATTACHMENT_FILE_WEIGHT');
?>
" data-original-title="<?php 
echo $attachment->getShortName();
?>
" href="<?php 
echo $attachment->getUrl();
?>
" title="<?php 
echo KunenaAttachmentHelper::shortenFileName($attachment->getFilename(), 0, 26);
?>
">
	<i class="icon icon-info"></i>
</a>
开发者ID:r-ahmadi,项目名称:Kunena-Forum,代码行数:30,代码来源:textlink.php

示例4: defined

<?php
/**
 * Kunena Component
* @package Kunena.Template.Crypsis
* @subpackage BBCode
*
* @copyright (C) 2008 - 2016 Kunena Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link https://www.kunena.org
**/
defined ( '_JEXEC' ) or die ();

/** @var KunenaAttachment $attachment */
$attachment = $this->attachment;

if (!$attachment->isImage()) return;

$config = KunenaConfig::getInstance();

$attributesLink = $config->lightbox ? ' rel="lightbox[imagelink' . $attachment->mesid . ']"' : '';
$attributesImg = ' style="max-height:' . (int) $config->imageheight . 'px;"';
?>

<a href="<?php echo $attachment->getUrl(); ?>" title="<?php echo KunenaAttachmentHelper::shortenFileName($attachment->getFilename(), 0,7); ?>"<?php echo $attributesLink; ?>>
	<img src="<?php echo $attachment->getUrl(); ?>"<?php echo $attributesImg; ?> alt="" />
</a>
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:26,代码来源:image.php


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