|
#1
|
|||
|
|||
|
Gravatars in comments
I made a simple addon to use a gravatar (globally recognized avatar; http://www.gravatar.com) with the comments.
It adds the gravatar as an img element (currently set to 24x24 but can be up to 80x80) before the commenter's name and date, which I've put before the comment body. If the commenter doesn't have a gravatar, the site linked above sends a 1 pixel transparent image instead. Thus it's useful to use css to style the image with a generic background image. The new tag is <GRAV_IMAGE_COMMENTS> I'm using it at my blog (link below) if you want to see it in action, although most days my shots are so lame there are no comments and thus no gravatars ;-) Anyway, here's the addon to try out. Please post here with troubles or suggestions. http://asiftosay.com/ftp/comments_gravatars.zip
__________________
http://asiftosay.com |
|
#2
|
||||
|
||||
|
i used favators for a while which in my opinion is more useful for photoblogging. almost all my commenters are fellow photobloggers with websites of their own. and about 80% of them have favicons.
i haven't seen gravatars as much.
__________________
Affordable Website Design in North Wales |
|
#3
|
||||
|
||||
|
Please sign in/up as a developer in pixelpost.org/v1 and upload your addon there too. Thanks!
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7 |
|
#4
|
|||
|
|||
|
Just a bug report on this, I just had a commenter that didnt have a gravatar, and instead of just the 1px transparent img being served it took the gravatar email address from the commenter before her and used it again. Not good.
On a second note I would prefer hard coding an img src to a default gravatar on my site as how the wordpress gravatar plugin works. But that plugin calls a function and I'm not sure how to code it or write it as the view image template is html and not php... some help would be appreciated. to see the bug view here: http://clintfisherart.com/features/u...?showimage=123 the wordpress gravatar function looks like so: Code:
<img src= "<?php gravatar("G", 80, "http://www.clintfisherart.com/graphics/grav.gif"); ?>" alt="" />
Code:
<?php
function gravatar($rating = false, $size = false, $default = false, $border = false) {
global $comment;
$out = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($comment->comment_author_email);
if($rating && $rating != '')
$out .= "&rating=".$rating;
if($size && $size != '')
$out .="&size=".$size;
if($default && $default != '')
$out .= "&default=".urlencode($default);
if($border && $border != '')
$out .= "&border=".$border;
echo $out;
}
?>
|
|
#5
|
|||
|
|||
|
I have the same problem too, I would prefer to have a default image for people who does not have avatar, how do we do that?
|
|
#6
|
|||
|
|||
|
I'm tryin to fig out how to do it with the wordpress code above but havent got it yet, the addon writer doesnt have any contact info on his site so I'm not sure. I'm just havin a bit of a prob with the function since the pp pages are html I cant call the function.
and also the fact that a commenter without a gravatar was given the previous commenters gravatar, thats a problem. |
|
#7
|
||||
|
||||
|
Add this function to your /includes/functions.php and use it in /index.php in comment code part. Quite easy stuff to do.
PS If you want send me on PM archive with all needed stuff and Il try to make from it a hack/addon. |
|
#8
|
|||
|
|||
|
PM sent GeoS
|
|
#9
|
||||
|
||||
|
OK. I got all files from your account.
More or less I got code. Tomorrow Ill clean it up, test and if all is OK, Ill publicate it. This addons shows, how much is to do with PP from its code side. IMHO Object Oriented way of programming is the best way to develope it in next stages. |
|
#10
|
|||
|
|||
|
great cant wait to check it out GeoS
|
| Post Reply |
| Thread Tools | |
|
|