Cataloger add-on - Shows only uploaded images

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
taxxi
Forum Members
Forum Members
Posts: 92
Joined: Sun May 14, 2006 8:22 pm

Cataloger add-on - Shows only uploaded images

Post 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
Last edited by taxxi on Mon May 15, 2006 9:23 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Module Cataloger - Show only uploaded images

Post by Dr.CSS »

have example?

  mark
taxxi
Forum Members
Forum Members
Posts: 92
Joined: Sun May 14, 2006 8:22 pm

Re: Module Cataloger - Show only uploaded images

Post by taxxi »

mark wrote: have example?

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

Before:
Image

After:
Image
Post Reply

Return to “Modules/Add-Ons”