![]() |
Avatar in header template
I am trying to show the user's current avatar in the forum header (version 3.7). I used this code in my vB 3.6 setup, which displays the users' current avatar, or the default avatar if they do not have one or aren't logged in.
HTML Code:
<if condition="$vbulletin->userinfo['avatarid']"> Any help on fetching the users current avatar in the header template? Thanks, Freek |
You'll find a clue in class_core.php (vB_Session constructor).
With your code, you would've needed a plugin to fetch the data - the data isn't there by default. |
Ah
My code works a 100% with this line added in the config.php file: define('AVATAR_ON_NAVBAR', 1); :D |
See, a bit of searching and you get a solution ;). Also, you don't have to have that code in config.php - you can have it in a plugin at init_startup. Furthermore, consider using the function fetch_avatar_from_userinfo, rather than putting all the logic in your templates.
|
All times are GMT. The time now is 07:08 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|