ok, here is a beginning, it works only for "direct upload" images (without validation)
in member.php find: if ($config['upload_notify'] == 1 && !$direct_upload) {
Insert above: if ($direct_upload) {
function _rename($old, $new){
$cwd = getcwd();
chdir(realpath(dirname($old)));
$ok = (rename(basename($old), basename($new))) ? 1 : 0;
chdir($cwd);
return $ok;
}
$media_path = MEDIA_PATH."/".$cat_id."/";
$thumb_path = THUMB_PATH."/".$cat_id."/";
$media_ext = strtolower(substr(strrchr($new_name,"."), 1));
$thumb_ext = strtolower(substr(strrchr($new_thumb_name,"."), 1));
$new_media = (_rename($media_path.$new_name, $media_path.$image_id.".".$media_ext)) ? $image_id.".".$media_ext : $new_name;
$new_thumb = (!empty($new_thumb_name) && _rename($thumb_path.$new_thumb_name, $thumb_path.$image_id.".".$thumb_ext)) ? $image_id.".".$thumb_ext : $new_thumb_name;
$sql = "UPDATE ".IMAGES_TABLE."
SET image_media_file = '$new_media', image_thumb_file = '$new_thumb'
WHERE image_id = $image_id";
$site_db->query($sql);
}
Tested on v1.7.1