Hi,
Try using my solution:
- Open file: \modules\mod_news_pro_gk4\tmpl\layout.parts.php
- Find code:
- Code: Select all
if($config['create_thumbs'] == 1 && $config['k2_thumbs'] == 1 && $item_image_exists == true){
// try to override standard image
if(NSP_GK4_Thumbs::createThumbnail($img_src, $config, true, false, $IMG_REL) !== FALSE) {
$uri = JURI::getInstance();
$IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/cache/'.NSP_GK4_Thumbs::translateName($img_src,$config['module_id'], true);
} elseif($config['create_thumbs'] == 1) {
jimport('joomla.filesystem.file');
if(is_file(JPATH_ROOT.DS.'modules'.DS.'mod_news_pro_gk4'.DS.'cache'.DS.'default'.DS.'default'.$config['module_id'].'.png')) {
$IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/cache/default/default'.$config['module_id'].'.png';
}
} else
$IMG_SOURCE = '';
} elseif($config['create_thumbs'] == 1 && $IMG_SOURCE != ''){
// try to override standard image
if(strpos($IMG_SOURCE,'http://') == FALSE) {
if(NSP_GK4_Thumbs::createThumbnail($IMG_SOURCE, $config) !== FALSE) {
$uri = JURI::getInstance();
$IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/cache/'.NSP_GK4_Thumbs::translateName($IMG_SOURCE,$config['module_id']);
} elseif ($item_image_exists == true) {
if(NSP_GK4_Thumbs::createThumbnail($img_src, $config, true) !== FALSE) {
$uri = JURI::getInstance();
$IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/cache/'.NSP_GK4_Thumbs::translateName($img_src,$config['module_id'], true);
} else {
jimport('joomla.filesystem.file');
if(is_file(JPATH_ROOT.DS.'modules'.DS.'mod_news_pro_gk4'.DS.'cache'.DS.'default'.DS.'default'.$config['module_id'].'.png')) {
$IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/cache/default/default'.$config['module_id'].'.png';
} else {
$IMG_SOURCE = '';
}
}
} else {
jimport('joomla.filesystem.file');
if(is_file(JPATH_ROOT.DS.'modules'.DS.'mod_news_pro_gk4'.DS.'cache'.DS.'default'.DS.'default'.$config['module_id'].'.png')) {
$IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/cache/default/default'.$config['module_id'].'.png';
} else {
$IMG_SOURCE = '';
}
}
}
} elseif($config['create_thumbs'] == 1) {
jimport('joomla.filesystem.file');
if($item_image_exists == true){
if(NSP_GK4_Thumbs::createThumbnail($img_src, $config, true) !== FALSE) {
$uri = JURI::getInstance();
$IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/cache/'.NSP_GK4_Thumbs::translateName($img_src,$config['module_id'], true);
} else {
jimport('joomla.filesystem.file');
if(is_file(JPATH_ROOT.DS.'modules'.DS.'mod_news_pro_gk4'.DS.'cache'.DS.'default'.DS.'default'.$config['module_id'].'.png')) {
$IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/cache/default/default'.$config['module_id'].'.png';
} else {
$IMG_SOURCE = '';
}
}
}
elseif(is_file(JPATH_ROOT.DS.'modules'.DS.'mod_news_pro_gk4'.DS.'cache'.DS.'default'.DS.'default'.$config['module_id'].'.png')) {
$IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/cache/default/default'.$config['module_id'].'.png';
}
}
- Change to:
- Code: Select all
$IMG_SOURCE = $uri->root().'modules/mod_news_pro_gk4/images/'.$news_alias.'.png';
- Create folder "images" under folder: /modules/mod_news_pro_gk4/
- Create your thumbnail images and save under the images folder with name format: ARTICLE_ALIAS.png (with ARTICLE_ALIAS is alias of your k2 item's alias.)