function smarty_block_thumbnail($params, $content, &$smarty, &$repeat) { if (isset($content)) { $thumb = new cf\Thumbnail($content, $params['width'], $params['height']); return $thumb->url(); } }
function getThumbnail($path, $width, $height) { if (!$path) { return ''; } \cf\Image::$USE_IMAGEMAGICK = \cf\Config::use_imagemagick; $thumb = new \cf\Thumbnail($_SERVER['DOCUMENT_ROOT'] . '/' . $path, $width, $height); return $thumb->url(); }