Page 1 of 1

Cataloger add-on - Shows only uploaded images

Posted: Sun May 14, 2006 9:02 pm
by taxxi
Hi all,
i've made a modify to the Cataloger Module that in the item page shows only the uploaded images.
It checks if the image file is present.
The code is:

file action.default.php
original code from line 12 to 20:

for ($i=1;$iconfig['root_url'].'/modules/Cataloger/Cataloger.Image.php?i='.$params['alias'].'_f_'.$i.'_'.$fullSize.'.jpg');
array_push($thumbArray, $gCms->config['root_url'].'/modules/Cataloger/Cataloger.Image.php?i='.$params['alias'].'_t_'.$i.'_'.$thumbSize.'.jpg');

$this->smarty->assign('image_'.$i.'_url',$gCms->config['root_url'].'/modules/Cataloger/Cataloger.Image.php?i='.$params['alias'].'_f_'.$i.'_'.$fullSize.'.jpg');
$this->smarty->assign('image_thumb_'.$i.'_url',$gCms->config['root_url'].'/modules/Cataloger/Cataloger.Image.php?i='.$params['alias'].'_t_'.$i.'_'.$thumbSize.'.jpg'
);

modified code from line 12 to 20:

for ($i=1;$iconfig['root_path'].'/uploads/images/catalog/'.$params['alias'].'_f_'.$i.'_'.$fullSize.'.jpg';
$imgpath = str_replace("\\", "/", $imgpath); //only for windows users
if (is_file($imgpath)) {
array_push($imageArray, $gCms->config['root_url'].'/modules/Cataloger/Cataloger.Image.php?i='.$params['alias'].'_f_'.$i.'_'.$fullSize.'.jpg');
array_push($thumbArray, $gCms->config['root_url'].'/modules/Cataloger/Cataloger.Image.php?i='.$params['alias'].'_t_'.$i.'_'.$thumbSize.'.jpg');
}
$this->smarty->assign('image_'.$i.'_url',$gCms->config['root_url'].'/modules/Cataloger/Cataloger.Image.php?i='.$params['alias'].'_f_'.$i.'_'.$fullSize.'.jpg');
$this->smarty->assign('image_thumb_'.$i.'_url',$gCms->config['root_url'].'/modules/Cataloger/Cataloger.Image.php?i='.$params['alias'].'_t_'.$i.'_'.$thumbSize.'.jpg'
);


I hope this will be useful to someone.
Bye Taxx

Re: Module Cataloger - Show only uploaded images

Posted: Sun May 14, 2006 9:15 pm
by Dr.CSS
have example?

  mark

Re: Module Cataloger - Show only uploaded images

Posted: Sun May 14, 2006 9:34 pm
by taxxi
mark wrote: have example?

  mark
yes! i've set 3 images per item.

Before:
Image

After:
Image