I tried searching for my question, but couldn't find it.
My blog has a handful of consistent readers, and they often leave comments. I wanted to embed avatars in their comments. Some of them aren't very computer saavy, so I don't mind editing their comments after they have posted them, and adding in whatever code is necessary to make this work.
I installed Gravatar/Favatar because it sounds like it will let me do this. However, I'm not sure how to use this plug-in. Can someone help me out with this?
For instance. If my friend left a comment on my blog. What can I do to modify that comment to inclue an avatar that I specify (and store on my site)?
Thanks!
Sillisquid
Favatar usage
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Favatar usage
Hi!
The gravatar plugin works based on email addresses. Your users need to submit their email address to your comments, and they need to register a picture on the gravatar.com site.
Then based on their email, their icon is displayed on your site.
A favator works a bit differently; it uses the "homepage url" adress of your users and checks if a "favicon.ico" is present, and then shows that one.
HTH,
Garvin
The gravatar plugin works based on email addresses. Your users need to submit their email address to your comments, and they need to register a picture on the gravatar.com site.
Then based on their email, their icon is displayed on your site.
A favator works a bit differently; it uses the "homepage url" adress of your users and checks if a "favicon.ico" is present, and then shows that one.
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!

Best regards,
Garvin
Of course you cannot force your commenters to enter their email/URL. Only if they do you can associate gravatars/favatars to them.jerwarren wrote:Do the commenters always put in the same name/email, etc? Or do you just know who they are?
Uhm, gravatars are fetched off-site. No images are stored on your server. You might want to read the FAQ on www.gravatar.comIf they do use email addresses, it wouldn't be too tough to automate this behavior, you'd just have to make and upload the proper images for each person.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
I'm not used to this forum stuff.. I was intending to ask the person who originally posted the question. I was going to help him rig it so that it works the way he wants, assuming his readers are already behaving in consistent ways.
I was just going to edit the template to load an image like for instance, "/avatars/$EMAIL_ADDRESS.png" (except using the actual variable name, which I haven't looked up yet ) where he would manually save whatever images he wanted to associate with each address/name.
If they aren't behaving in consistent ways, then I'd have to think about it some more.
I was just going to edit the template to load an image like for instance, "/avatars/$EMAIL_ADDRESS.png" (except using the actual variable name, which I haven't looked up yet ) where he would manually save whatever images he wanted to associate with each address/name.
If they aren't behaving in consistent ways, then I'd have to think about it some more.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Ah! Uck! Argh. My mistake. I fully understand you. I just didn't pay attention enough to look up the poster name properly. Sorry for that confusion!
Best regards,
Garvin
Ah! Uck! Argh. My mistake. I fully understand you. I just didn't pay attention enough to look up the poster name properly. Sorry for that confusion!
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
sillisquid
- Posts: 3
- Joined: Thu Aug 17, 2006 7:32 pm
Thanks for the replies, folks. Sorry, I've been away from the computer for a few days....
You seem to know exactly what I'm trying to do, so any help/suggestions/advice is greatly appreciated! Thanks!!
Yes, they are pretty consistent with this information. I figure if they put something different, I could modify the comment, and "fix" it for them.Do the commenters always put in the same name/email, etc? Or do you just know who they are?
If they do use email addresses, it wouldn't be too tough to automate this behavior, you'd just have to make and upload the proper images for each person.
Are they consistent in doing this?
You seem to know exactly what I'm trying to do, so any help/suggestions/advice is greatly appreciated! Thanks!!
OK, I just whipped up something that will do what you want. It doesn't currently take actual gravatar images into account however, so if you use my system and a user does actually have a gravatar image, you'll get both.You seem to know exactly what I'm trying to do, so any help/suggestions/advice is greatly appreciated! Thanks!!
What you need to do is:
1) add the following to your 'comments.tpl' file. (which most likely is currently residing in serendipity/templates/default/) If your template is using a modified one, it will be in that template's directory.
Code: Select all
{if $comment.email}
<img src="{$serendipityBaseURL}/avatars/{$comment.email}" align="left">
{/if}
2) create a directory named "avatars" in the root of your serendipity installation, and put any avatar images that you want to associate with users in it. Name the files like this:
Code: Select all
jer[at]nyquil.org
test[at]test.org
billg[at]microsoft.com
3) create a default avatar to display if someone doesn't have one on your system, and name it as "default_avatar.png" in your newly created "avatars" directory. If you don't want a generic image, and would prefer to just not display an avatar, make this default avatar image a 1x1 pixel transparent gif/png or something. Feel free to steal my default one if you'd like.
4) create a file named ".htaccess" in your "avatars" folder, and put the following line in it:
Code: Select all
ErrorDocument 404 /avatars/default_avatar.pngIf you want to see what this looks like in action, check out http://comics.nyquil.org/archives/4-Par ... l#comments .
The little questionmarky ones on the left are the default avatar image, and the ones on the right are gravatars. I just posted the "(this is a test)" comment so you can see a local avatar along with the default avatars.
In the long-term this could probably be incorporated into the actual gravatar plugin so that there isn't a conflict between gravatars and your handmade local avatars, but I don't really feel like going to that effort just now
Let me know if you have any troubles with anything, I'll gladly help you figure it out.
-
sillisquid
- Posts: 3
- Joined: Thu Aug 17, 2006 7:32 pm