vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Avatar Problem In Header (https://vborg.vbsupport.ru/showthread.php?t=255333)

CustomizeVB 12-16-2010 01:13 PM

Avatar Problem In Header
 
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:

Code:

<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.

kh99 12-17-2010 09:10 PM

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.


All times are GMT. The time now is 02:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00988 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete