View Full Version : Avatar Problem In Header
CustomizeVB
12-16-2010, 01:13 PM
My problem is it seemed like it was working at first. It displayed my avatar when I was logged in, but then I changed my avatar and it changed all over my vBulletin forum, except for the area where I customized for it.
Below is the code I have:
<td><a href="profile.php?$session[sessionurl]do=editavatar"><img src="image.php?u=$bbuserinfo[userid]" alt="Your avatar" border="0" /></a></td>
Can anyone help with this?
Lynne
12-16-2010, 10:10 PM
It's probably cached. Did you do a Force Refresh of the page?
CustomizeVB
12-17-2010, 02:32 AM
Yes I did. Is there any way I can get around this?
Lynne
12-17-2010, 03:15 AM
And what was showing where the avatar should be after you did a Force Refresh? It shouldn't be showing the old avatar, because you replaced it in the database and old avatars are not saved.
CustomizeVB
12-17-2010, 02:21 PM
The old avatar is still in place for some reason. ? First time I have had this problem.
Lynne
12-17-2010, 02:24 PM
Then you didn't go a Force Refresh cuz, as I said, the old avatar is NOT stored when you change it - it is replaced in the database. There is no way it can still be grabbing the old avatar from the database. The only other thing it could be is some caching on your server.
CustomizeVB
12-17-2010, 07:59 PM
Maybe I'm not understanding what you mean by force refresh?
Lynne
12-17-2010, 08:40 PM
On a mac, it's shift + refresh, not sure about on a PC. It forces the page to be rebuilt completely - grab all new scripts and images directly from the server and not use any browser cached version.
The browser caches images (as Lynne pointed out) and when you load a page with an image the browser already has, it sends a request asking to resend only if that image has changed since the last time it was loaded. But image.php doesn't do a check for when the avatar last changed (probably to avoid doing db queries), instead it always responds to say that it hasn't changed (which is probably why your image never changed).
To handle image changes, other places in vB (like the postbit) make the url different if the image has been updated, so it looks like a different image to the browser. For avatars, it adds "&dateline=" then the value of "dateline" from the customavatar table of the db. So you could figure out how to add that to the url in your image src, or maybe you could add something else which you know will be unique to force it to load every time (like maybe the value of TIMENOW).
Looking at the code in image.php, it also looks like adding "&type=regcheck" would force it to reload the image, but I don't know what that's really for.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.