Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 12-16-2010, 01:13 PM
CustomizeVB CustomizeVB is offline
 
Join Date: Aug 2006
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 12-16-2010, 10:10 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's probably cached. Did you do a Force Refresh of the page?
Reply With Quote
  #3  
Old 12-17-2010, 02:32 AM
CustomizeVB CustomizeVB is offline
 
Join Date: Aug 2006
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes I did. Is there any way I can get around this?
Reply With Quote
  #4  
Old 12-17-2010, 03:15 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 12-17-2010, 02:21 PM
CustomizeVB CustomizeVB is offline
 
Join Date: Aug 2006
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The old avatar is still in place for some reason. ? First time I have had this problem.
Reply With Quote
  #6  
Old 12-17-2010, 02:24 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 12-17-2010, 07:59 PM
CustomizeVB CustomizeVB is offline
 
Join Date: Aug 2006
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Maybe I'm not understanding what you mean by force refresh?
Reply With Quote
  #8  
Old 12-17-2010, 08:40 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 12-17-2010, 09:10 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:27 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04110 seconds
  • Memory Usage 2,231KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete