php forum
php mysql forum
php mysql smarty
 
Topic Options
#313431 - 03/07/07 11:31 PM [7.x] Fix the Avatars
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
Some users experience problems with avatars, if you set the max height and width and there isn't one associated with an avatar, it'll skew them from loading. If you don't set a max height and width it'll display them as a 1x dot in IE...

The only *real* fix for this, is to not specify a height and width when loading the avatars...

This should be rather quick to do, and only short script mods. I will be updating this thread periodically when I notice other pages it needs applied to; so check back!

Thread Viewing, Flat View
edit scripts/showflat.inc.php
Find:
Code:
				$postrow[$i]['Picture'] = "<img src=\"$Picture\" alt=\"\" $picsize />";


Replace With:
Code:
				$postrow[$i]['Picture'] = "<img src=\"$Picture\" alt=\"\" />";


Show Thread, Threaded View
Edit scripts/showthreaded.inc.php
Code:
			$Picture = "<img src=\"$Picture\" alt=\"\" $picsize />";


Replace With:
Code:
			$Picture = "<img src=\"$Picture\" alt=\"\" />";
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#313432 - 03/08/07 01:19 AM Re: [7.x] Fix the Avatars [Re: Gizmo]
ADWOFF Offline
Content Queen

Registered: 05/07/01
Posts: 709
Loc: Pennsylvania
Gizzy is my hero!

Thank YOU!

And my community thanks you! smile
_________________________
Sue
adwoff.com

Top
#313433 - 03/08/07 01:31 AM Re: [7.x] Fix the Avatars [Re: ADWOFF]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
hehehe...

BTW, I looked at the showprofile and userlist sections where the avatars are loaded, but they don't seem to specify a size; so those pages should be exempt from any editing afaik.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#313649 - 03/20/07 01:41 PM Re: [7.x] Fix the Avatars [Re: Gizmo]
Fred Johnson Offline
Junior Member

Registered: 07/14/06
Posts: 21
Actually, they do use the size function.

FYI, this only stops the pages from specifying the size, but it doesn't really fix the problem. When you take this out the avatars can be ANY size, which isn't good.

The solution here would be to change the getimagesize function (when I find it) and alter it to work properly.

I have a mod that did this properly and I can probably port the code pretty easily if I can find how/where to make the changes.

Fred

Top
#313650 - 03/20/07 03:00 PM Re: [7.x] Fix the Avatars [Re: Fred Johnson]
Fred Johnson Offline
Junior Member

Registered: 07/14/06
Posts: 21
I found the problem/solution. It is a simple typo in the changebasic.inc.php file (in /scripts).

I outlined the change here: UBBCentral

For everyone that doesn't want to click on the link (and have to scroll down)...

Find:
Code:
$imagehw = getimagesize("{$config['UPLOADED_AVATAR_URL']}/$Picturefile");


Replace with:
Code:
$imagehw = getimagesize("{$config['UPLOADED_AVATAR_PATH']}/$Picturefile");


Basically it is a typo, changing 'UPLOADED_AVATAR_URL to 'UPLOADED_AVATAR_PATH.

Change this 1 line, resave the file and your gold, no need to change or remove any of the size stuff anywhere else.

Edit: One last thing, this only fixes the future avatars, any that are currently uploaded by the users need to be reuploaded. This is because a size of 80x80 is already "set" in the user database because with the typo it couldn't "find" the file to check for file sizes so it put the max (80x80). Having the users reupload their avatars after you make this change will correct it.


Edited by Fred Johnson (03/20/07 03:57 PM)

Top
#313652 - 03/20/07 05:10 PM Re: [7.x] Fix the Avatars [Re: Fred Johnson]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
A good comprimise would be to apply both mods and leave the max avitar height and width set so future avitars do not go above them.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#314506 - 06/20/07 09:39 PM Re: [7.x] Fix the Avatars [Re: Gizmo]
sirdude Moderator Offline
Enthusiast

Registered: 11/08/03
Posts: 442
Loc: SoCal
viewmessage.inc.php is affected as well with $picsize being set.

just an fyi wink
_________________________

Top


Moderator:  sirdude 
Who's Online
2 registered (arentzen, blaaskaak), 27 Guests and 8 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
How to hide sub forums from summary page
by blaaskaak
12/03/08 09:54 AM
Spell Check [beta]
by Bill B
12/01/08 09:16 PM
PhotoPost BB Code Popup
by AllenAyres
12/01/08 09:41 AM
Problems reading a lot of old posts here
by AllenAyres
12/01/08 09:35 AM
Forum 'Trader Ratings'.
by AllenAyres
12/01/08 09:33 AM
Customization needed
by Gizmo
11/12/08 12:28 PM
Team UBBDev Rides Again!
by AllenAyres
11/11/08 02:16 PM
New Mods
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Spell Check [beta]
by
10/17/06 09:24 PM
Newest Members
David DelMonte, nick1, Begbie, cenk, MATTO
13363 Registered Users
Top Posters
AllenAyres 25452
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks