Ok, let me show you something.
This is what you posted:
Code:
// if user is know, then welcome
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
eval("\$welcometext = \"".gettemplate('forumhome_welcometext')."\";");
eval("\$logincode = \"".gettemplate('forumhome_logoutcode')."\";");
eval("\$newposts = \"".gettemplate('forumhome_newposts')."\";");
} else {
$welcometext = "";
eval("\$newposts = \"".gettemplate('forumhome_todayposts')."\";");
eval("\$logincode = \"".gettemplate('forumhome_logincode')."\";");
}
if ($bbuserinfo['userid']!=0) {
$avatarurl=getavatarurl($bbuserinfo[userid]);
if ($avatarurl=='')
$avatarurl='vbimages/noavatar.gif';
} else {
$avatarurl='vbimages/guestavatar.gif';
}
You see that the
forumhome_welcometext template is being eval() BEFORE the code for the avatar?
That's why it won't show up in that template, because that template is being "called" before you do the avatar thing.
Anyway, I combined some stuff for you. Use this, instead of that block you posted:
Code:
// if user is know, then welcome
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");
if ($bbuserinfo['userid']!=0) {
$avatarurl=getavatarurl($bbuserinfo[userid]);
if ($avatarurl=='')
$avatarurl='vbimages/noavatar.gif';
$username=$bbuserinfo['username'];
eval("\$welcometext = \"".gettemplate('forumhome_welcometext')."\";");
eval("\$logincode = \"".gettemplate('forumhome_logoutcode')."\";");
eval("\$newposts = \"".gettemplate('forumhome_newposts')."\";");
} else {
$avatarurl='vbimages/guestavatar.gif';
$welcometext = "";
eval("\$newposts = \"".gettemplate('forumhome_todayposts')."\";");
eval("\$logincode = \"".gettemplate('forumhome_logincode')."\";");
}