srh_file_icon
srh_file_icon displays either the file extension (eg PDF, DOC, ZIP) or an icon image for a file. Icon images must be present in the /images directory for each file type required (eg pdf.png, doc.png — filenames should be lowercase). The icon image type (eg png, gif) can also be specified.
Use: txp:srh_file_icon displaytype=”“ imagetype=”“ />
attributes:
- displaytype – ‘text’ or ‘image’ defaults to ‘text’
- imagetype – the type of image file used for the icon, defaults to png
You can get your file icons here:
http://www.zap.org.au/documents/icons/file-icons/sample.html
This plugin is a far more basic verion of mrz_file_preview (which did a lot more and was written by someone who knows PHP).
This is my first plugin, and if you look at the code you can probably tell I don’t know PHP at all. If I keep reading my PHP book, I might get around to adding some other obvious attributes like class, width & height, alt-text etc.
shaun









You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:
Commented (1)
Great utility! Note that it isn’t consistent with capitalization. It outputs pdf.png and JPG.png. Name your files accordingly because some browsers are picky.
Subscribe to this article's comments RSS feed. [ ? ] View Recent Comments across the site. Get a Gravatar.