View Full Version : Setting Asymetric Custom Avatar Sizes?
NecroSocial
10-18-2001, 07:26 PM
My forum uses avatars sized 60px wide by 100px tall and allows users to upload their own custom avatars. However I can't seem to find a way to set the board so that it allows/forces the users to upload 60x100 avatars of their own. I can set it at 60x60 and 100x100 but there appears to be no way to set up the board to accept asymetricaly-sized avatars. This is a big issue on my forum since there are many graphic artists who frequent the boards and who would like to customize their avatars. Any help you guys can offer?
-Necro
Steve Machol
10-18-2001, 07:29 PM
You're right, there's no way to do this with the standard vB. You'll need a hack - probably just a simple change to avatar.php. I'll move this to the Hacks request forum.
Admin
10-18-2001, 07:34 PM
Umm, nice idea. :)
Steve Machol
10-18-2001, 07:36 PM
Actually come to think of it, this would require a change to admin/index.php as well.
Admin
10-18-2001, 07:39 PM
Not really, just to member.php.
(and run two queries)
Steve Machol
10-18-2001, 07:44 PM
But don't you have the change the 'Change options' setting in the Admin CP so you can set both height and width?
Admin
10-18-2001, 07:49 PM
Oh no my friend, that is done automatically. :)
(hack comes in a couple of minutes)
Admin
10-18-2001, 07:52 PM
Ok, first of all in member.php replace this:
if ($imginfo[0]>$avatarmaxdimension or $imginfo[1]>$avatarmaxdimension) {
with this:
if ($imginfo[0]>$avatarmaxwidth or $imginfo[1]>$avatarmaxheight) {
Now run these queries:
INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,optioncode,displayorder) VALUES (NULL,26,'Maximum width','avatarmaxwidth',64,'Maximum width (in pixels) that the custom avatar image can be','',9);
INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,optioncode,displayorder) VALUES (NULL,26,'Maximum Height','avatarmaxheight',64,'Maximum height (in pixels) that the custom avatar image can be','',10);
DELETE FROM setting WHERE varname='avatarmaxdimension';
(make sure you only run once!)
And that's it! :)
NecroSocial
10-18-2001, 08:52 PM
Thanks for the info guys!
I'll give this code a run through and see what happens. Hopefully I'll never have to see a square avatar on my forum again. :D
-Necro
NecroSocial
10-22-2001, 03:22 PM
Okay so the hack works just fine however I now have a problem with the member.php page where it doesn't show the avatar sizes that I've implemented.
An example would be that, instead of showing:
Note: the maximum size of your custom image is 60 by 100 pixels or 10024 bytes (whichever is smaller).
it'll show:
Note: the maximum size of your custom image is by pixels or 10024 bytes (whichever is smaller).
How do I fix this?
-Necro
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.