//********************************************************************** // Grab your gravatars! // Function implemented by Korbo // http://goulvench.free.fr/ // 24th of March 2005 // ********************************************************************* // ********************************************************************* // Pick the one you want and put it somewhere your php files will find it // You can also use include_once ('gravatar.php'); // then call it from wherever you want as in: "gravatar($email)" // The image tag is self-closing in XHTML, change that if your site is in sloppy html. // Better even, update your site: html is long dead, time to code properly. // Table layout is over now, time to use the fantastic tools at hand! // (See what people do to the www.csszengarden.com with _only_ css...) // And don't forget to position the image with CSS! // The following rule will place the gravatar 35 pix left of its normal position: // .gravatar {position: absolute; left: -35px} // You'll need to add {position: static} to the nearest block ancester // for the absolute position to be relative to it, not to the page. // ********************************************************************* // ********************************************************************* // Want just the bare bones? // These three lines will grab a 40px gravatar without fussing about // ********************************************************************* function gravatar($email) { $size = "40"; //From 1 to 80 inclusive $grav_url="http://www.gravatar.com/avatar.php?gravatar_id=".md5($email)."&size=".$size; return "\"\""; } // ********************************************************************* // Want big picture with white border and safe rating? // Copy all this, modify the variables and let it roll... // ********************************************************************* function gravatar($email) { $rating = "G"; //Can be G, PG, R or X $size = "80"; //From 1 to 80 inclusive $border = "fff"; //Hex value (FF0000 or simply FOO) without the # $grav_url="http://www.gravatar.com/avatar.php?gravatar_id=".md5($email)."&rating=".$rating"&size=".$size."&border=".$border; return "\"\""; } // ********************************************************************* // ********************************************************************* // Want full control? // Copy all this, modify the variables and let it roll... // ********************************************************************* function gravatar($email) { $rating = "R"; //Can be G, PG, R or X $size = "40"; //From 1 to 80 inclusive $default = "http://www.example.com/nograv.gif"; //Full URL to a default image if you choose to have one $border = "f00"; //Hex value (FF0000 or simply FOO) without the # $grav_url="http://www.gravatar.com/avatar.php?gravatar_id=".md5($email)."&rating=".$rating"&size=".$size."&default=".$default."&border=".$border; return "\"\""; } // Hope you find this usefull! // Check back for more PHP/CSS stuff on // http://goulvench.free.fr/