View Full Version : Display Avatar in Header
paulyy
09-16-2004, 11:42 PM
I would like to display the users Avatar in the head template, so it appears on every page. I tried using
<img style="float:left;" src="$avatarurl" alt="<phrase 1="$bbuserinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" />
and
<img style="float:left;" src="$avatarurl" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />
But to no avail. Can someone please point out what I am doing wrong, and help me correct this please? :)
paulyy
09-17-2004, 01:17 AM
<a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=32560" target="_blank">https://vborg.vbsupport.ru/showt...threadid=32560</a>
Found this, is there a vB3.0.3 hack that works for all pages?
ok this supuse to be simple
in global.php just before ?> do something like that
$avatar = $DB_SITE->query_first("select avatarpath from avater where avatarid='$bbuserinfo[avatarid]' ");
$avatarurl =$avatar['avatarpath'];
the code supuse to work
its only for the case that $avatarurl not defined
paulyy
09-17-2004, 01:48 AM
Sorry, I don't understand the code or instructions :(
ok ill do it again
open the file global.php
(on your root dir)
find : ?>
before add :
$avatar = $DB_SITE->query_first("select avatarpath from avater where avatarid='$bbuserinfo[avatarid]' ");
$avatarurl =$avatar['avatarpath'];
save the file and upload it back to the server
now you defiend $avatarurl so its can show its have the link
its like you doing <img src="">
cuse $avatarurl not defiend.
so the 2 lines of code i gave you defien $avatarurl
thats all.
am i more clear now ?
paulyy
09-17-2004, 02:22 AM
Yep :) Thanks a lot!
So to show the avatar URL I just use <img style="float:left;" src="$avatarurl" alt="<phrase 1="$bbuserinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" /> ?
EDIT: Doesn't work, I get an error on this line;
$avatar = $DB_SITE->query_first("select avatarpath from avatar where avatarid='$bbuserinfo[avatarid]' ");
Am I suppose to change something?
paulyy
09-17-2004, 12:30 PM
Anyone else?
paulyy
09-17-2004, 02:45 PM
I just edited the phpinclude_start template and got it working. Thanks anyway :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.