It's a template from a custom hack, but it contains the following
PHP Code:
$attachment[filename]
<a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if>>
<img class="thumbnail" src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&stc=1&thumb=0&d=$attachment[thumbnail_dateline]" border="0" align="center"></a>
<if condition="$show['br']"><br /><br /></if>
I added $attachment[filename] in the above code to see if it pulls the file names of the attached files, and it does...so the if statement you provided should work? Don't no why it doesn't.