Cataloger add-on - Shows only uploaded images
Posted: Sun May 14, 2006 9:02 pm
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
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