mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
finetuning.
git-svn-id: file:///svn/phpbb/trunk@7454 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
5e7a80cbd8
commit
58ac5df6b3
1 changed files with 10 additions and 3 deletions
|
@ -101,6 +101,11 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// nuke this avatar
|
||||||
|
$sql = 'UPDATE ' . USERS_TABLE . "
|
||||||
|
SET user_avatar = '', user_avatar_type = 0
|
||||||
|
WHERE user_id = {$row['user_id']}";
|
||||||
|
$db->sql_query($sql);
|
||||||
echo '<br /> Failed updating user ' . $row['user_id'] . "\n";
|
echo '<br /> Failed updating user ' . $row['user_id'] . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,11 +133,13 @@ function adjust_avatar($old_name, $midfix)
|
||||||
global $config, $phpbb_root_path;
|
global $config, $phpbb_root_path;
|
||||||
|
|
||||||
$avatar_path = $phpbb_root_path . $config['avatar_path'];
|
$avatar_path = $phpbb_root_path . $config['avatar_path'];
|
||||||
if (@file_exists($avatar_path . '/' . $old_name) && @is_writable($avatar_path . '/' . $old_name))
|
$extension = strtolower(substr(strrchr($old_name, '.'), 1));
|
||||||
|
$new_name = $config['avatar_salt'] . '_' . $midfix . '.' . $extension;
|
||||||
|
|
||||||
|
if (@file_exists($avatar_path . '/' . $old_name) && @is_writable($avatar_path . '/' . $old_name) && @is_writable($avatar_path . '/' . $new_name))
|
||||||
{
|
{
|
||||||
$new_name = $config['avatar_salt'] . '_' . $midfix . '.' . substr(strrchr($old_name, '.'), 1);
|
|
||||||
@rename($avatar_path . '/' . $old_name, $avatar_path . '/' . $new_name);
|
@rename($avatar_path . '/' . $old_name, $avatar_path . '/' . $new_name);
|
||||||
return $midfix . '.' . substr(strrchr($old_name, '.'), 1);
|
return $midfix . '.' . $extension;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue