vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Template Hook Avatar (https://vborg.vbsupport.ru/showthread.php?t=293008)

Kriskof 12-15-2012 04:12 PM

Template Hook Avatar
 
Hi, I'm currently using 3.8.7 and want to display and switch the user's avatar on the side of the template when they change it but can't seem to get it to work.

I'm currently using:

Code:

<img src="image.php?u=$bbuserinfo[userid]">
This displays their current avatar, but the image stays the same even if they change avatars or even logout and log back in. I want it to change when they change their avatar. I read that you need can use a template hook to get this done, but I can't find the solution for it. If anybody can help, that'd be great. Thanks.

kh99 12-15-2012 05:15 PM

image.php only works if the user has a custom avatar, and the reason that you're having that problem is that the browser caches it. To get around that it needs to have the "avatardate" field as a parameter. We discussed it a while ago in this thread: http://www.vbulletin.org/forum/showt...ight=image.php (I think the final working code is in the next to the last post).

Kriskof 12-15-2012 05:31 PM

Quote:

Originally Posted by kh99 (Post 2390913)
image.php only works if the user has a custom avatar, and the reason that you're having that problem is that the browser caches it. To get around that it needs to have the "avatardate" field as a parameter. We discussed it a while ago in this thread: http://www.vbulletin.org/forum/showt...ight=image.php (I think the final working code is in the next to the last post).

Wow, I spent all that time looking and it was right there. Got it to work, thank you very much for the response and the code itself.


All times are GMT. The time now is 05:59 PM.

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.00973 seconds
  • Memory Usage 1,714KB
  • 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)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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