A minor but quick change: I've included the ability for comments to show an avatar. Essentially sign up at gravatar.com, upload an image that "represents" you, and it'll then appear here if you comment.
For the Graffiti freaks out there, here's the line of code in my comments.view
file (this is a file loaded by my post.view
file that displays all the comments, plus the add-a-comment form):
$macros.gravatar($comment.Email, $comment.Username, $comment.IPAddress, "%{size ='60'}")
Enjoy.
Now playing:
Zero 7 - Passing By (Album Version)
(from When It Falls)
4 Responses
#1 Terri Morton said...
29-Dec-08 8:00 PMFWIW, I had picked up somewhere that it's a good idea to test for the presence of an IP address, so I use a variation of the above:
#2 julian m bucknall said...
29-Dec-08 10:26 PMTerri, I had a quick look through the Graffiti.Code code to $macros.Gravatar using Reflector. It seems that if the IP address is null (but not empty), a method (Identiicon.Code()) gets called that will throw an exception. That's the only reason I can see for checking for an IP address.
Cheers, Julian
#3 Terri Morton said...
30-Dec-08 9:11 AMI found the source of that code, in FriendFeed. Someone had imported comments from dasBlog, and those do not include IP addresses. So I adopted his approach to be safe. friendfeed.com/.../Has-anyone-setu
#4 julian m bucknall said...
30-Dec-08 10:54 AMMagic, Terri. Thanks for the explanation and the link.
Cheers, Julian
Leave a response
Note: some MarkDown is allowed, but HTML is not. Expand to show what's available.
_emphasis_
**strong**
[text](url)
`IEnumerable`
* an item
1. an item
> Now is the time...
Preview of response