if ($error == "") {
if ($userdata['user_avatar'] == "" && !empty($_FILES['user_avatar'])) {
$newavatar = $_FILES['user_avatar'];
if (is_uploaded_file($newavatar['tmp_name']) && $newavatar['size'] <= [color=blue]30720[/color]) {
$avatarext = strrchr($newavatar['name'],".");
if (eregi(".gif", $avatarext) || eregi(".jpg", $avatarext) || eregi(".png", $avatarext)) {
$avatarname = substr($newavatar['name'], 0, strrpos($newavatar['name'], "."));
$avatarname = $avatarname."[".$userdata['user_id']."]".$avatarext;
$set_avatar = "user_avatar='$avatarname', ";
move_uploaded_file($newavatar['tmp_name'], IMAGES."avatars/".$avatarname);
chmod(IMAGES."avatars/".$avatarname,0644);
$size = getimagesize(IMAGES."avatars/".$avatarname);
if ($size['0'] > [color=red]200[/color] || $size['1'] > [color=red]200[/color]) {
unlink(IMAGES."avatars/".$avatarname);
}
}
}
}
Quote
jangus74 wrote:
Is it a gif or jpg? I have found that some file formats show the red x for some reason. After switching the file format, the avatar loads fine. Couldn't tell u why though....
Quote
Steff wrote:
So I guess that the Super Admin cannot set the avatar himself for the users...oh well ;)
Quote
Kengun wrote:Quote
Steff wrote:
So I guess that the Super Admin cannot set the avatar himself for the users...oh well ;)
Super Admin can set the avatar for all members.
Quote
Daywalker wrote:
Look near the bottom of update_profile_includes.php in the Includes folder.
You'll be looking for:Code Download sourceif ($error == "") {
if ($userdata['user_avatar'] == "" && !empty($_FILES['user_avatar'])) {
$newavatar = $_FILES['user_avatar'];
if (is_uploaded_file($newavatar['tmp_name']) && $newavatar['size'] <= [color=blue]30720[/color]) {
$avatarext = strrchr($newavatar['name'],".");
if (eregi(".gif", $avatarext) || eregi(".jpg", $avatarext) || eregi(".png", $avatarext)) {
$avatarname = substr($newavatar['name'], 0, strrpos($newavatar['name'], "."));
$avatarname = $avatarname."[".$userdata['user_id']."]".$avatarext;
$set_avatar = "user_avatar='$avatarname', ";
move_uploaded_file($newavatar['tmp_name'], IMAGES."avatars/".$avatarname);
chmod(IMAGES."avatars/".$avatarname,0644);
$size = getimagesize(IMAGES."avatars/".$avatarname);
if ($size['0'] > [color=red]200[/color] || $size['1'] > [color=red]200[/color]) {
unlink(IMAGES."avatars/".$avatarname);
}
}
}
}
Red = Height and Width thing
Blue = Filesize
Category Forum
Official Core Support - 6Labels
None yet
Statistics
0 participants
Notifications
You are not receiving notifications from this thread.
Related Questions