self created thumbnails on "Latest Projects" module
- GK User
- Thu Jan 19, 2012 5:33 pm
Hello,
I want to change the Thumbnails shown on News Pro Module "Latest Projects". I want to use self created thumbnails not generated ones. E.G. Customer Logo instead of Article Picture. If I overwrite the thumbnails in cach Folder, they will be overwritten again. Is there a way? Thank you
I want to change the Thumbnails shown on News Pro Module "Latest Projects". I want to use self created thumbnails not generated ones. E.G. Customer Logo instead of Article Picture. If I overwrite the thumbnails in cach Folder, they will be overwritten again. Is there a way? Thank you
-
- Fresh Boarder
- GK User
- Thu Jan 19, 2012 6:45 pm
Hi,
Try using my solution:
- Open file: \modules\mod_news_pro_gk4\tmpl\layout.parts.php
- Find code:
- Change to:
- 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.)
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.)
-
- Platinum Boarder
- GK User
- Thu Jan 19, 2012 8:40 pm
Hey Don, you're great , thank you very much
-
- Fresh Boarder
- GK User
- Thu Jan 19, 2012 9:19 pm
it worx! thanks a lot !
-
- Fresh Boarder
- GK User
- Fri Jan 20, 2012 7:09 am
You are most welcome, feel free to let me know if you need any other helps.
-
- Platinum Boarder
- GK User
- Thu Mar 28, 2013 6:31 pm
Don Lee wrote: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.)
The code in my version doesn't match this. I tried deleting what was similar and replacing, but it's not working. I'd really like to use custom thumbnails. Can you help?
-
- Fresh Boarder
6 posts
• Page 1 of 1