Still having the same problem, I think the problem might be at admin/post_mod_profiles.php, It might be this part of the code at that file, but I'm not sure if it is or how to fix:
Code:
if ( $_POST['confirm'] )
{
$query = '';
foreach ( $_POST as $key => $value )
{
if ( 'mem' == $value )
$query .= " IDMember = '$key' OR ";
}
$query = "UPDATE ProfilesSettings SET `Status` = 'Active' WHERE " . $query . " '1'='0' ";
db_res( $query );
}
elseif ( $_POST['delete'] )
{
$query = '';
foreach ( $_POST as $key => $value )
{
if ( 'mem' == $value )
$query .= " IDMember = '$key' OR ";
}
$query1 = "SELECT `BackgroundFilename` FROM ProfilesSettings WHERE " . $query . " '1'='0' ";
$arr = db_res( $query1 );
while ( $arr = mysql_fetch_array( $res ) )
{
if (file_exists($dir['profileBackground'] . $arr['BackgroundFilename'])) unlink($dir['profileBackground'] . $arr['BackgroundFilename']);
}
$query2 = "UPDATE ProfilesSettings SET `BackgroundFilename` = '' WHERE " . $query . " '1'='0' ";
db_res( $query2 );
}
Also I noticed something else, when a member tries to upload a background picture with a file size bigger than the allowed max photo file size (you get a blank page after trying to upload) it is not applied to be the background image (which is ok), but the image is uploaded to the server, this is wasting hard disk space.
How can I set it to NOT upload the background image file if it's size is bigger than the allowed max photo file size?
I think this problem have something to do with the function moveUploadedImage located at inc/images.inc.php. Maybe this part of the code, but I'm not sure if it is or how to fix:
Code:
function moveUploadedImage( $_FILES, $fname, $path_and_name, $maxsize='', $imResize='true' )
{
global $max_photo_height;
global $max_photo_width;
$height = $max_photo_height;
if ( !$height )
$height = 400;
$width = $max_photo_width;
if ( !$width )
$width = 400;
if ( $maxsize && ($_FILES[$fname]['size'] > $maxsize || $_FILES[$fname]['size'] == 0) )
{
if ( file_exists($_FILES[$fname]['tmp_name']) )
{
unlink($_FILES[$fname]['tmp_name']);
}
return false;
}
else
{
$scan = getimagesize($_FILES[$fname]['tmp_name']);
if ( ($scan['mime'] == 'image/jpeg' && $ext = '.jpg' ) || ( $scan['mime'] == 'image/gif' && $ext = '.gif' ) ||
( $scan['mime'] == 'image/png' && $ext = '.png' ) || ( $scan['mime'] == 'image/bmp' && $ext = '.bmp' ) )
{
$path_and_name .= $ext;
move_uploaded_file( $_FILES[$fname]['tmp_name'], $path_and_name );
if ( $imResize )
imageResize( $path_and_name, $path_and_name, $width, $height );
}
else
{
return IMAGE_ERROR_WRONG_TYPE;
}
}
return $ext;
}
Help please.
Bookmarks