Only works if you store profile pics in the filesystem
First you need to setup the creation of thumbnails for profile pics.
Create the directory customprofilepics/thumbs and make sure it is writable by your web server.
Create a plugin for: userpicdata_postsave
and add the following code...
PHP Code:
if ($this->table == 'customprofilepic')
{
@unlink($oldthumbfilename);
require_once(DIR . '/includes/class_image.php');
$image =& vB_Image::fetch_library($this->registry);
$imageinfo = $image->fetch_image_info($newfilename);
if ($imageinfo[0] > 150 OR $imageinfo[1] > 150)
{
$filename = 'file.' . ($imageinfo[2] == 'JPEG' ? 'jpg' : strtolower($imageinfo[2]));
$thumbnail = $image->fetch_thumbnail($filename, $newfilename, 150, 150);
}
elseif ($filenum = @fopen($thumbfilename, 'wb'))
{
@fwrite($filenum, $this->info['filedata']);
@fclose($filenum);
}
if ($thumbnail['filedata'] AND $filenum = @fopen($thumbfilename, 'wb'))
{
@fwrite($filenum, $thumbnail['filedata']);
@fclose($filenum);
unset($thumbnail);
}
}
To generate thumbs for existing profile pics, just move them from the filesystem into the database and back again.