XOOPS  2.6.0
helper.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  */
11 
13 
24 class Thumbs extends HelperAbstract
25 {
31  public function init()
32  {
33  $this->_dirname = 'thumbs';
34  }
35 
46  {
47  //$xoops = \Xoops::getInstance();
48  if ($width==0 && $height==0) {
49  $width = $this->getConfig('thumbs_width');
50  $height = $this->getConfig('thumbs_height');
51  }
52  $sizeDir = sprintf('/%01dx%01d/', $width, $height);
53  $pathParts = pathinfo($imgPath);
54  if ($pathParts['dirname'] == '.') {
55  $pathParts['dirname'] = '';
56  }
57  $thumbPath = 'assets/thumbs/' . $pathParts['dirname'].$sizeDir.$pathParts['basename'];
58 
59  return $thumbPath;
60  }
61 }
buildThumbPath($imgPath, $width, $height)
Definition: helper.php:45
$imgPath
Definition: thumbrender.php:27
$thumbPath
Definition: thumbrender.php:37
$height
$width
init()
Definition: helper.php:31