XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
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
12
use
Xoops\Module\Helper\HelperAbstract
;
13
24
class
Thumbs
extends
HelperAbstract
25
{
31
public
function
init
()
32
{
33
$this->_dirname =
'thumbs'
;
34
}
35
45
public
function
buildThumbPath
(
$imgPath
,
$width
,
$height
)
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
}
Thumbs\buildThumbPath
buildThumbPath($imgPath, $width, $height)
Definition:
helper.php:45
$imgPath
$imgPath
Definition:
thumbrender.php:27
Thumbs
Xoops\Module\Helper\HelperAbstract
Definition:
HelperAbstract.php:21
$thumbPath
$thumbPath
Definition:
thumbrender.php:37
$height
$height
Definition:
avatar_custom.php:41
$width
$width
Definition:
avatar_custom.php:40
Thumbs\init
init()
Definition:
helper.php:31
Xoops\Module\Helper\HelperAbstract\getConfig
getConfig($name)
Definition:
HelperAbstract.php:98
HelperAbstract
usr64
htdocs
modules
thumbs
class
helper.php
Generated on Fri May 22 2015 03:07:03 for XOOPS by
1.8.9.1