mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-28 23:03:25 +09:00
Do not create thumbnails if thumbnail_type is none
This commit is contained in:
parent
73a690bfae
commit
af7bab4814
2 changed files with 37 additions and 18 deletions
|
|
@ -567,6 +567,24 @@ class commentItem extends Object
|
|||
return;
|
||||
}
|
||||
|
||||
// Get thumbnai_type information from document module's configuration
|
||||
if(!in_array($thumbnail_type, array('crop', 'ratio', 'none')))
|
||||
{
|
||||
$config = $GLOBALS['__document_config__'];
|
||||
if(!$config)
|
||||
{
|
||||
$oDocumentModel = getModel('document');
|
||||
$config = $oDocumentModel->getDocumentConfig();
|
||||
$GLOBALS['__document_config__'] = $config;
|
||||
}
|
||||
$thumbnail_type = $config->thumbnail_type ?: 'crop';
|
||||
}
|
||||
|
||||
if ($thumbnail_type === 'none')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if($this->isSecret() && !$this->isGranted())
|
||||
{
|
||||
return;
|
||||
|
|
@ -584,12 +602,6 @@ class commentItem extends Object
|
|||
return;
|
||||
}
|
||||
|
||||
// get thumbail generation info on the doc module configuration.
|
||||
if(!in_array($thumbnail_type, array('crop', 'ratio')))
|
||||
{
|
||||
$thumbnail_type = 'crop';
|
||||
}
|
||||
|
||||
// Define thumbnail information
|
||||
$thumbnail_path = sprintf('files/thumbnails/%s', getNumberingPath($this->comment_srl, 3));
|
||||
$thumbnail_file = sprintf('%s%dx%d.%s.jpg', $thumbnail_path, $width, $height, $thumbnail_type);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue