home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Plugins / wp_gravatar / gravatar.php
PHP Script  |  2004-11-21  |  995b  |  29 lines

  1. <?php
  2.  
  3. /*
  4. Plugin Name: Gravatar
  5. Plugin URI: http://www.gravatar.com/implement.php#section_2_2
  6. Description: This plugin allows you to generate a gravatar URL complete with rating, size, default, and border options. See the <a href="http://www.gravatar.com/implement.php#section_2_2">documentation</a> for syntax and usage.
  7. Version: 1.1
  8. Author: Tom Werner
  9. Author URI: http://www.mojombo.com/
  10.  
  11. CHANGES
  12. 2004-11-14 Fixed URL ampersand XHTML encoding issue by updating to use proper entity
  13. */
  14.  
  15. function gravatar($rating = false, $size = false, $default = false, $border = false) {
  16.     global $comment;
  17.     $out = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($comment->comment_author_email);
  18.     if($rating && $rating != '')
  19.         $out .= "&rating=".$rating;
  20.     if($size && $size != '')
  21.         $out .="&size=".$size;
  22.     if($default && $default != '')
  23.         $out .= "&default=".urlencode($default);
  24.     if($border && $border != '')
  25.         $out .= "&border=".$border;
  26.     echo $out;
  27. }
  28.  
  29. ?>