PDA

View Full Version : Admin Avatar Options


Neo
04-27-2002, 10:00 PM
This is a add that Dark Angelus (https://vborg.vbsupport.ru/showthread.php?s=&threadid=37963) requested and something that I wanted but could not find >< I am not to sure if this is already made but here it is.

Info:
This allows admins/smods/mods to have a bigger set avatar and avatar file size from the admin cp. Aswell as make it so it can define the width and height of the avatar.

Install Info:
3 New queries
1 new template
1 template edit
1 file edit


Hope you enjoy :)

Lesane
04-28-2002, 07:13 PM
Great hack Neo :D


*Edit* Looked Wrong *Edit*

John
04-28-2002, 07:18 PM
But doesn't this hack allow admins and mods to have a bigger file size than Registered Users?

Orlandu
04-28-2002, 07:19 PM
That hack, Lesane, is to set it for everyone. This hack that neo released is so you can have a different set height for admins and their avatars. So if you are an admin, you can have a larger avatar than that of a normal member.

I think it is very useful and may end up using it myself.

Lesane
04-28-2002, 07:21 PM
aah yes, i looked wrong. Great hack.

Neo
04-28-2002, 07:42 PM
Thank you :)

JulianD
04-28-2002, 08:03 PM
Nice hack. Thanks for sharing neo.

Dark Angelus
04-28-2002, 08:04 PM
i copy and past the last insert thingy in my mysql database and there is an error
_______

INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,optioncode,displayorde r) VALUES (NULL,26,'Admin Maximum File Size','amfs','20000','The maximum file size of admins (in bytes) that an avatar can be.

1 KB = 1024 bytes
1 MB = 1048576 bytes','','6')")

MySQL said: You have an error in your SQL syntax near '")' at line 1
Back
____

What Am I Doing Wrong

Neo
04-28-2002, 08:47 PM
Fixed :)

geniuscrew
05-16-2002, 05:45 PM
is there a way to allow admins and modertors to have different sized avatars using this? This would be of great help.

Thanx

scud
09-16-2002, 03:12 PM
Great Hack, thx, I'll use it :)

Jalrock
09-22-2002, 11:29 PM
.

Jalrock
09-23-2002, 05:35 PM
Never mind. :)

Jalrock
09-26-2002, 05:32 PM
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.
-----------------------------------------------------------------------

// ##### 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]\");");

}

TECK
09-26-2002, 05:36 PM
Jalrock, [code] vb code... it looks more elegant and it keeps the formatting.
is hard for us to look at the code like that. can you reformat it please? thanks.

and now for mad dog neo.. vb225??????????????? :)
you are gonna have a headache on my board neo, there are no avatars...

Jalrock
09-26-2002, 05:42 PM
reformatted sorry.

Mono
01-30-2003, 11:24 AM
How would you do it to make it so multiple usergroups can have this feature. Like on my forum there are 3 groups of authority.

The group numbers are 7, 6, and 5.

geniuscrew
03-14-2003, 10:45 AM
Mmm I have exactly that - are their avatars the same size?

S.Shady
05-21-2003, 11:13 PM
i would like to see this with the option of turning off the reg avatars and only alowing admins,etc. the option for an avatar only.

Plz if this hack exists point me to it. i thought i saw one before but cant find one for anything.

Does this work for 2.3.0 ?

?????p?x????
08-10-2003, 04:17 PM
Can this also be utilized to grant moderators and administrators the exclusive right to use avatars? In other words, can this hack help me make the use of avatars a strictly mod/admin perk only?

Bandwidth may pose a problem by the end of my forum's setup, and I was thinking of permitting only authorities this privilege.

Edit: Nevermind. (http://www.vbulletin.org/hacks/index.php?s=&action=showhack&hackid=251) :cool: