Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Addons

Post Reply
 
Thread Tools
  #1  
Old 08-26-2005, 07:10 AM
derevaun Offline
pp regular
 
Join Date: Mar 2005
Location: oly, wa
Posts: 47
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
Reply With Quote
  #2  
Old 08-26-2005, 09:15 AM
Joe[y]'s Avatar
Joe[y]+ Offline
Team Pixelpost
 
Join Date: Mar 2005
Location: UK
Posts: 3,101
Send a message via MSN to Joe[y]
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.
Reply With Quote
  #3  
Old 08-26-2005, 09:25 PM
raminia's Avatar
raminia+ Offline
Team Pixelpost
 
Join Date: Jan 2005
Location: FL, US
Posts: 3,706
Send a message via Yahoo to raminia
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
Reply With Quote
  #4  
Old 09-19-2005, 06:58 PM
lokjah Offline
pp veteran
 
Join Date: Jul 2005
Posts: 52
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="" />
and is simply formed from:

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 .= "&amp;rating=".$rating;
	if($size && $size != '')
		$out .="&amp;size=".$size;
	if($default && $default != '')
		$out .= "&amp;default=".urlencode($default);
	if($border && $border != '')
		$out .= "&amp;border=".$border;
	echo $out;
}

?>
TIA,
Reply With Quote
  #5  
Old 09-21-2005, 04:49 AM
cbtoday Offline
pixelpost guru
 
Join Date: Aug 2005
Posts: 128
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?
Reply With Quote
  #6  
Old 09-21-2005, 04:59 AM
lokjah Offline
pp veteran
 
Join Date: Jul 2005
Posts: 52
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.
Reply With Quote
  #7  
Old 09-21-2005, 07:33 AM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
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.
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
  #8  
Old 09-21-2005, 02:43 PM
lokjah Offline
pp veteran
 
Join Date: Jul 2005
Posts: 52
PM sent GeoS
Reply With Quote
  #9  
Old 09-22-2005, 10:24 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
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.
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
  #10  
Old 09-23-2005, 01:06 AM
lokjah Offline
pp veteran
 
Join Date: Jul 2005
Posts: 52
great cant wait to check it out GeoS
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 11:14 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs