Something is still wrong. The specified usergroupes can use the admin avatar size but now the regular members can not change their avatars. It says thankyou for modifing your profile..... but nothing happens. No error message or anything! Please help.
This is the portion of code I suspect to be in error.
-----------------------------------------------------------------------
Code:
// ##### Admin / Mod Diff Upload Size
if ($bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==7 || $bbuserinfo[usergroupid]==5 || $bbuserinfo[usergroupid]==8 || $bbuserinfo[usergroupid]==11) {
if ($imginfo[0]>$amw or $imginfo[1]>$amh) {
eval("standarderror(\"".gettemplate("error_aabd")."\");");
}
} else {
if ($imginfo[0]>$avatarmaxdimension or $imginfo[1]>$avatarmaxdimension) {
eval("standarderror(\"".gettemplate("error_avatarbaddimensions")."\");");
}
}
// ##### Admin / Mod Diff Upload Size
}
if ($imginfo[2] != 1 and $imginfo[2] != 2 and $imginfo[2] != 3) {
@unlink($filename);
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
} else {
if (1 or !$allowimgsizefailure) {
@unlink($filename);
eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
}
}
// read file
$filesize=@filesize($filename);
if ($bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==7 || $bbuserinfo[usergroupid]==5 || $bbuserinfo[usergroupid]==8 || $bbuserinfo[usergroupid]==11) {
if ($filesize>$amfs) {
eval("standarderror(\"".gettemplate("error_avatartoobig")."\");");
// file size too big
} else {
if ($filesize>$avatarmaxsize) {
eval("standarderror(\"".gettemplate("error_avatartoobig")."\");");
// file size too big
exit;
}
}
$filenum=@fopen($filename,"rb");
$filestuff=@fread($filenum,$filesize);
@fclose($filenum);
@unlink($filename);
if ($avexists=$DB_site->query_first("SELECT userid FROM customavatar WHERE userid=$bbuserinfo[userid]")) {
$DB_site->query("UPDATE customavatar SET filename='".addslashes($avatarfile_name)."',dateline='".time()."',avatardata='".addslashes($filestuff)."' WHERE userid=$bbuserinfo[userid]");
} else {
$DB_site->query("INSERT INTO customavatar (userid,avatardata,dateline,filename) VALUES ($bbuserinfo[userid],'".addslashes($filestuff)."','".time()."','".addslashes($avatarfile_name)."')");
}
}
} else {
$avatarid=verifyid("avatar",$avatarid);
$avatarinfo=$DB_site->query_first("SELECT minimumposts FROM avatar WHERE avatarid=$avatarid");
if ($avatarinfo[minimumposts]>$bbuserinfo[posts]) {
eval("standarderror(\"".gettemplate("error_avatarmoreposts")."\");");
// not enough posts error
exit;
}
$DB_site->query("DELETE FROM customavatar WHERE userid=$bbuserinfo[userid]");
}
} else {
$avatarid=0;
$DB_site->query("DELETE FROM customavatar WHERE userid=$bbuserinfo[userid]");
}
$DB_site->query("UPDATE user SET avatarid='".addslashes($avatarid)."',usergroupid='$bbuserinfo[usergroupid]' WHERE userid='$bbuserinfo[userid]'");
eval("standardredirect(\"".gettemplate("redirect_updatethanks")."\",\"usercp.php?s=$session[sessionhash]\");");
}