NEW!! - Docicons Plugin Version 2 Released!
20th Sept 2010.
Version 2 of the Docicons Plugin is ready for download. Features included:
- All attachment files can have a small icon added to enhance their appearance
- Works in posts and pages
- Enhanced Admin screen with lots of options
- Integration with Hana FLV Player plugin to embed videos and sound files!
- You DON’T have to put special codes into your posts – it’s automatic!
This plugin will insert icon links to document attachments within a post. More than that, it will embed audio or video files (flv’s) into posts / pages, replacing the simple attachment links you get when you upload media. The idea was originally based on work by http://www.tgrayimages.com/automate-file-attachments-on-your-wordpress-posts/ . NOTE: IF you want to use embedded media – videos and audio players with this plugin you need to also install Hana FLV Player plugin.
DOWNLOAD Version 2.1
(By the way, this is an example of the type of icon that is added to attachments!)
Unzip the package, copy the Docicons folder to your Plugins folder and activate. The admin panel is available under Settings. Optionally install Hana FLV Player.
IF YOU USE MY WORK (OR IF YOU JUST FEEL LIKE IT!) PLEASE MAKE A DONATION TO MY POCKET MONEY. THANKS!
Example 1: a video:
Example 2: an mp3:
I decided to integrate with Hana rather than other flv players because of the GPL distributable licences. In a future release of Docicons I will be able to directly distribute Flowplayer with my plugin. At present you must download and activate Hana as well if you want to use the embeddable media features. If you don’t, and all you want is nice document icons in your posts, then it will work without it.
Note that the way WordPress works means that an attachment is only really ever “attached” to one post or page. So the Docicons plugin will work on those posts / pages to which a file was initially loaded up into. If you attach a file from the media library to another post, the Docicons plugin has no way to determine that it is also attached to that post and will not alter the way it is displayed.
Docicons Version 1
The Docicons plugin adds a small icon to the left of an attachment link in your WordPress posts and pages. The inserted icon is dependant on the mime type of the document attached to the post, so a Word attachment gets a word-type icon and a PDF gets a pdf-type icon.
An example can be seen on the download link below, where a zip icon image has been added by the plugin!
Note that the plugin only works for attachments to Posts / Pages, not any manually inserted link to a document, however you could achieve consistency by manually inserting from the same icon set. All the images are under the mime subfolder.
The plugin is based on the excellent work done by Tony Gray at http://www.tgrayimages.com/automate-file-attachments-on-your-wordpress-posts/ and the icon images used are his except in that I made them smaller than his originals. Tony’s code has been used but modified extensively to add the images inline with the attachment links rather than altogether at the end of the post.
This is v1.0 which adds the icons automatically to all the post attachments in every post. Future enhancements if I get round to it will be to include Admin options for new mime types and image options; and maybe the audio player wrapper option.
Hope some folk will find this (my first ever WP plugin) useful. If you use it let me know what you think.