[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [ic] check image available


> J van Dijk-BV Kunststoffenindustrie Attema writes: 
> 
> > How can i check (in perl within a component) if an image in the 
> filesystems exists ?
> > I tried to use stat, but gives an error.
> > If an image is not (yet) available, we want to show an "image 
> not available" image.
> > Thanks for any hints, Jan
> 
> Not entirely sure what you mean with 'in perl within a 
> component', but I can 
> think of the following : 
> 
> if (-f  FILENAME) {
>  exists;
> }
> else {
>  does not exist;
> } 
> 
> Within IC something like:
> [if type="file" term="images/filename.jpg"]
> file exists
> [else]
> file does not exist
> [/else]
> [/if] 

I know you mentioned doing it in perl, but have you considered something like this around the image:

[if file __DOCROOT____IMAGE_DIR__/thumb/[item-code]_b.jpg]<a href="[area [item-code]]">
<IMG SRC="thumb/[item-code]_b.jpg" ALT="[item-description]"></a>[else]<IMG SRC="sorry_no_img_b.gif" ALT="Sorry, no image available">
[/else]
[/if]

Good luck!

Curt Hauge


_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.