Hi all. I am having trouble with this code. After users login, it is not changing the login block to welcome user. You login to the site, but the form fields are still there where only it should say welcome user. Any help?
////////////////////////login////////////////////////////////
echo"<td align='center'>";
if ( $xoopsUser ) {
$username = $xoopsUser->uname();
}
if ( $xoopsUser ) {
echo"<table border='0' height='22' cellspacing='0' cellpadding='0' width='100%'>"
."<tbody>"
."<tr>"
."<td width='30%'>"
."<p>Hello $username</p>";
echo"</td>";
} else {
echo"<table style='BORDER-COLLAPSE: collapse' bordercolor='#000000' height='22' cellspacing='0' cellpadding='0' width='100%' border='0'>"
."<tbody>"
."<tr>"
."<form action='".XOOPS_URL."/user.php' method='post'>"
."<td width='80%'>Username"
."<input style='font-size: 9pt; padding-top: 2; background-color: #26231c; color: #ffffff; border: 1 solid #000000' size='10' name='uname' type='text'>Password"
."<input style='font-size: 9pt; padding-top: 2; background-color: #26231c; color: #ffffff; border: 1 solid #000000' type='password' size='10' name='pass'>"
."<input type='hidden' value='NS-User' name='module'><input type='hidden' value='login' name='op'><input type='hidden' value='".XOOPS_URL."/index.php' name='url'> "
."<input type='image' align='absmiddle' src='".XOOPS_URL."/themes/".$xoopsTheme['thename']."/images/signup.gif' width='20' height='16' alt='µn¤J'> <a href='".XOOPS_URL."/user.php#lost' class='pn-white'><font class='pn-white'>Lost Password</font></a><font class='pn-white'></font>";
echo"</td></form>";
}
if ( $xoopsUser ) {
echo"<td align='right' width='70%'><table border='0' cellpadding='0' cellspacing='0' width='100%'>"
."<tr height='22'>"
."<td width='100%' align='right'>";
echo"<form action='".XOOPS_URL."/search.php' method='post'>
<input style='font-size: 9pt; padding-top: 2; background-color: #26231c; color: #ffffff; border: 1 solid #000000' size='20' type='text' name='query' ><input type='hidden' name='action' value='results' > <input type='image' align='absmiddle' src='".XOOPS_URL."/themes/".$xoopsTheme['thename']."/images/search-01.gif' width='19' height='18' alt='¯¸¤º·j´M'> ¡i<font class='pn-white'><a href='".XOOPS_URL."/search.php' class='pn-normal-white'>¶i¶¥·j´M</a>¡j </font>";
echo"</td></form>"
."</tr>"
."</table></td>";
} else {
echo"<td align='right' width='20%'><img height='15' src='".XOOPS_URL."/themes/".$xoopsTheme['thename']."/images/spacer.gif' width='5' border='0'> <font class='pn-white'><a href='".XOOPS_URL."/register.php' class='pn-normal-white'>Register</a> </font></td>";
}
echo"</tr>"
."</tbody>"
."</table>";
echo"</td>";
echo"<td align='center'>";
echo"</td><td align='right'>";
echo"</td>"
."</tr>"
."</table>";
echo"</td>"
."</tr>"
."</table>";
echo"<center><table border='0' cellpadding='0' cellspacing='0' width='780'>"
."<tr height='12'>"
."<td width='100%' background='".XOOPS_URL."/themes/".$xoopsTheme['thename']."/images/t-titlebg2.gif' >";
echo"</td>"
."</tr>"
."</table>";