Plugin Directory

User Photo

Author: Weston Ruter

Allows a user to associate a profile photo with their account through their "Your Profile" page. Admins may add a user profile photo by accessing the "Edit User" page. Uploaded images are resized to fit the dimensions specified on the options page; a thumbnail image correspondingly is also generated. User photos may be displayed within a post or a comment to help identify the author. New template tags introduced are:

  • userphoto_the_author_photo()
  • userphoto_the_author_thumbnail()
  • userphoto_comment_author_photo()
  • userphoto_comment_author_thumbnail()

The first two should be placed in the posts loop near the_author(), and the second two in the comments loop near comment_author() (or their respective equivalents). Furthermore, userphoto_the_author_photo() and userphoto_the_author_thumbnail() may be called anywhere (i.e. sidebar) if $authordata is set.

The output of these template tags may be modified by passing four parameters: $before, $after, $attributes, and $default_src, as in: userphoto_the_author_photo($before, $after, $attributes, $default_src). If the user photo exists (or $default_src is supplied), then the text provided in the $before and $after parameters is respectively prefixed and suffixed to the generated img tag (a common pattern in WordPress). If attributes are provided in the $attributes parameter, then they are returned as attributes of the generated img element. For example: userphoto_the_author_photo('', '', array(style => 'border:0'))

Uploaded images may be moderated by administrators via the "Edit User" page.

Localizations included for Spanish, German, Dutch, and Polish.

If you value this plugin, please donate to ensure that it may continue to be maintained and improved.

Changelog

2008-04-23: 0.8.0.5

  • Added localization for Polish (thanks Maciej!)

2008-04-04: 0.8.0.4

  • Fixed issue where incorrect path was being generated for default photo.

2008-04-04: 0.8.0.3

  • Using wp_mail instead of mail (Thanks again, Kyle.)

2008-03-28: 0.8.0.2b

  • Ensured that "unapproved" photos are not displayed. (Thanks Kyle.)

2008-02-24: 0.8.0.2

  • Made minor improvement to security.

2008-02-13: 0.8.0.1

  • Removed print_r() from being called when using $default_src (thanks David!)

2008-02-04: 0.8

  • Allow before and after text to be outputted when there is a user photo.
  • Allow attributes to be passed into template tags, including a default SRC value to be used when there is no user photo.
  • Added Dutch localization translated by Joep Stender (thanks!)

2008-01-07: 0.7.4b

  • Added German localization translated by Robert Harm (thanks!)

2008-01-06: 0.7.4

  • Added support for localization and added Spanish localization translated by Pakus (thanks!)

2008-01-02: 0.7.3

  • Fixed issue where the post author photo was inadvertently used for non-registered comment author photos.

2007-12-28: 0.7.2

  • Improved error message raised when unable to create 'userphoto' directory under /wp-content/uploads/. It now asks about whether write-permissions are set for the directory.
  • Improved the plugin activation handler.
  • All uploaded images are now explicitly set to chmod 666.

2007-12-22: 0.7.1

  • All functions (and template tags) now are prefixed with "userphoto_"

2007-12-18: 0.7.0.1

  • Now using siteurl option instead of home option
  • Fixed the inclusion of the stylesheet for the options page

Todo

  1. Add a management page to allow admins to quickly approve/reject user photos.
  2. Add option so that when a photo is rejected, the user is notified.
  3. Restrict image types acceptable?
  4. Add an option to indicate a default photo to be used when none supplied.
Tags: , ,