Kaitlyn2004
Fri 3rd Aug '07, 10:29pm
When you have an attachments for an issue, if it is an image it can display a thumbnail - otherwise it is just blank. This instead displays an icon for the filetype:
Open pt_attachmentbit and find:
<if condition="$attachment['thumbnail_filesize']">
<a href="projectattachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]" target="_blank"><img src="projectattachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&thumb=1" alt="" border="0" /></a>
<else />
</if>Replace with:
<if condition="$attachment['thumbnail_filesize']">
<a href="projectattachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]" target="_blank"><img src="projectattachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&thumb=1" alt="" border="0" /></a>
<else />
<img src="images/attach/$attachment[extension].gif" width="16" height="16" alt="" />
</if>If you don't want to display the image, you can always display the icon... replace with this instead:
<img src="images/attach/$attachment[extension]_32.gif" width="32" height="32" alt="" />Finally, create a plugin for "project_issue_attachmentbit" and use this code:
$attachment['extension'] = substr($attachment['filename'], strrpos($attachment['filename'], '.')+1);
Open pt_attachmentbit and find:
<if condition="$attachment['thumbnail_filesize']">
<a href="projectattachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]" target="_blank"><img src="projectattachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&thumb=1" alt="" border="0" /></a>
<else />
</if>Replace with:
<if condition="$attachment['thumbnail_filesize']">
<a href="projectattachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]" target="_blank"><img src="projectattachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&thumb=1" alt="" border="0" /></a>
<else />
<img src="images/attach/$attachment[extension].gif" width="16" height="16" alt="" />
</if>If you don't want to display the image, you can always display the icon... replace with this instead:
<img src="images/attach/$attachment[extension]_32.gif" width="32" height="32" alt="" />Finally, create a plugin for "project_issue_attachmentbit" and use this code:
$attachment['extension'] = substr($attachment['filename'], strrpos($attachment['filename'], '.')+1);