Working out a couple bugs if you have it so attachments are saved to the file system and writing some code that lets you rebuild the album thumbnails.
Make my above fixes, that will fix images from being escapes twice. The image gets escaped already if you have it so your attachments are saved in the MySQL data base. This would cause errors with the thumbnails. The thumbnail doesn't get escaped when you save the files to the file system so this code fixes that and also fixes a small bug if theres an error with the thumbnail.
After you installed this hack and weasles fix,
find in path/to/forums/includes/functions_upload.php:
PHP Code:
if ($type == 'profilepic')
{
require_once('./includes/functions_image.php');
$image['name'] = $upload_name;
$image['tmp_name'] = $filename;
$thumbnail = fetch_thumbnail_from_image($image);
$thumbnail = $thumbnail['filedata'];
// Display thumbnail error to admins in an attempt to cut down on support requests due to failed thumbnails.
if (!$thumbnail AND $imageerror AND $permissions['adminpermissions'] & CANCONTROLPANEL)
{
eval('$error = "' . fetch_phrase($imageerror, PHRASETYPEID_ERROR) . '";');
$errors[] = array(
'filename' => $attachment_name,
'error' => $error
);
}
}
and replace it with:
PHP Code:
if ($type == 'profilepic')
{
require_once('./includes/functions_image.php');
$image['name'] = $upload_name;
$image['tmp_name'] = $filename;
$thumbnail = fetch_thumbnail_from_image($image);
$imageerror = $thumbnail['imageerror'];
$thumbnail = $thumbnail['filedata'];
if ($vboptions['attachfile'])
{
$thumbnail = $DB_site->escape_string($thumbnail);
}
// Display thumbnail error to admins in an attempt to cut down on support requests due to failed thumbnails.
if (!$thumbnail AND $imageerror AND $permissions['adminpermissions'] & CANCONTROLPANEL)
{
eval('$error = "' . fetch_phrase($imageerror, PHRASETYPEID_ERROR) . '";');
$errors[] = array(
'filename' => $attachment_name,
'error' => $error
);
}
}
The rebuilding of the album thumbnails code is almost done.