Forums / Setup & design / File_exist: A question

File_exist: A question

Author Message

Zinistry Vacana

Monday 05 May 2003 6:42:31 am

Is it possible to check for file_exist in a template?
I have pictures of users in the system (search-site which lists user-information) and want to show pictures of them, but don't want the img tag to be showed in the browser if the image does not exist. Mozilla don't show it anyway if the Image don't exist, but IE does, so I have to do a check here.

Something like this, but the show=eq (file check if not empty)don't work:
{section show=eq("http://www.*.*/pictures/$SearchResult:item.email[.jpg]",' ' )|not() }
<td><img src="http://www.*.*/pictures/$SearchResult:item.email.jpg"</td>
{/section]

Don't know how to solve this problem :/
Shortly: the users are in the db, $SearchResult:item.email contains the emails looped and listed out for every user, and this data ($) I use to retrieve the Image which have name like the email.

Marco Zinn

Tuesday 06 May 2003 1:16:13 pm

No clue, but a counter-question ;)

Why don't you expand your class (user class, if you use this) to have a new attribute "image", upload them there and check for the existance of that attribute ?
I suppose, that would "better" and easier to do.

Marco
http://www.hyperroad-design.com