Textpattern plugin : ajw_favatar

14 March 2005 @ early evening | Comments (1)

Plugin Details

Download:
ajw_favatar
Version:
0.2
Forum:
Read discussion
Status on this site:
Disabled

Please use forum for all bug reports and questions

Requires Textpattern 1.0RC3 revision 180 or above (revs 142 thru 179 can make it work with a one-line hack).

Summary

This plugin allows for display of favatars (favicon avatars) in comments and is intended to be used within your default comment form. The output is a complete image tag; if no image is found or some problem occurs, no image tag is output.

It is based on Paul James’ Favatars, but I’ve chosed to drop a large chunk of his code to speed it up a bit. Another difference is the cached filename, which uses md5 encoding of the domain just to prevent illegal filenames.

Attributes

class (optional)
Allows for adding a class to the image tag.
alt (optional)
Allows for adding an alt attribute to the image tag.
format (optional)
Allows for specifying type of image tag to output (html/xhtml). This plugin assumes you are using xhtml.
Default: xhtml
usecache (optional, but recommended)
Usage of this parameter indicates you are using a cache, i.e. usecache="1".
Default: 0
cachedir (optional)
If you are using an image cache you must specify what directory you intend on storing the cached favicons in. Do use a leading slash. Do not use a trailing slash. You may need to change the permissions (chmod) the directory to allow for write permissions.
Default: /images/cache
cachetime (optional)
Time until the cache expires, measured in seconds.
Default: 86400 (1 day)

Examples

<txp:ajw_favatar usecache="1" cachedir="/images" />
<txp:ajw_favatar class="favatar" usecache="1" format="html" />

Revision History

v0.2

  • Added optional alt attribute so as to not break page validation


1 comment

1

Hrm. Things don’t seem to actually be working for me. It seems to be caching my site’s favicon, then using that for each comment.

You can see a sample at http://auto.nomo.us. Any ideas what I’ve done wrong?

Oh, I’m using RC3, rev227 I think. Definately newer than 180.

Todd → auto.nomo.us

Comments are closed for this article.

Previously