Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Plugin: Avatar Upload


LMD
Participant

@louisedade

Thumbnails are now an undocumented feature in version 0.8.3.

It’s undocumented because I think it ought to be road tested first. To use thumbnails you have to enable the feature in the plugin file itself, it is not configurable in the admin options page.

1. Open up bb-avatar-upload.php and in the configuration settings class, scroll down to the following section:

// Use a thumbnail image (hidden feature for now). 1 = yes / 0 = no (default)
$this->use_thumbnail = 0;
$this->thumb_width = 25;
$this->thumb_height = 25;

Set $this->use_thumbnail to 1 to enable and change the dimensions if desired.

When enabled, whenever a user uploads an avatar a smaller copy is created with the prefix ‘thumb.‘ So the avatar username.jpg will have a thumbnail called thumb.username.jpg (the file type changes with the avatar file type, so PNG avatars produce PNG thumbnails etc).

2. You can access the thumbnail image with the following function call:

echo avatarupload_displaythumb($user->ID);

An image tag is returned with the class name avatar_thumb.

<img src="thumb.username.jpg" width="25" height="25" alt="Username" class="avatar_thumb">

I think that covers everything, let me know if you have any problems.

Skip to toolbar