hello
this is my viewuser.php
I added the marriage update but i want to have 2 little changes on my viewuser.php
1 I want the marriage part to be moved ( now its on the top of my vieuwuser above every thing else )
2 al the info is center but i want this to be on the left of the page
who whant to help me ????????
<?
include "globals.php";
$housequery=1;
$db->connect();
$userst=$db->query("SELECT * FROM userstats");
$usa=$db->fetch_row($userst);
$ts=$usa['strength']+$usa['agility']+$usa['guard']+$usa['labour']+$usa['IQ'];
$usa['strank']=get_rank($usa['strength'],'strength');
$usa['agirank']=get_rank($usa['agility'],'agility');
$usa['guarank']=get_rank($usa['guard'],'guard');
$usa['labrank']=get_rank($usa['labour'],'labour');
$usa['IQrank']=get_rank($usa['IQ'],'IQ');
$tsrank=get_rank($ts,'strength+agility+guard+labour+IQ');
$usa['strength']=number_format($usa['strength']);
$usa['agility']=number_format($usa['agility']);
$usa['guard']=number_format($usa['guard']);
$usa['labour']=number_format($usa['labour']);
$usa['IQ']=number_format($usa['IQ']);
$ts=number_format($ts);
$_GET['u'] = abs((int) $_GET['u']);
if(!$_GET['u'])
{
print "Invalid use of file";
}
else
{
$q=$db->query("SELECT u.*,us.*,c.*,h.*,g.*,f.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN cities c ON u.location=c.cityid LEFT JOIN houses h ON u.maxwill=h.hWILL LEFT JOIN gangs g ON g.gangID=u.gang LEFT JOIN fedjail f ON f.fed_userid=u.userid WHERE u.userid={$_GET['u']}");
if($r['gympass'] == 0) { $gym="<font color=red>No[/b]"; } else if($r['gympass'] == 1) { $gym="<font color=green>Yes</font>";}
if($db->num_rows($q) == 0)
{
print "Sorry, we could not find a user with that ID, check your source.";
}
{
$r=$db->fetch_row($q);
$enperc=(int) ($ir['energy']/$ir['maxenergy']*100);
$hpperc=(int) ($ir['hp']/$ir['maxhp']*100);
$hpopp=100-$hpperc;
$enopp=100-$enperc;
if($r['user_level'] == 1) { $userl="Member"; } else if($r['user_level'] == 2) { $userl="Admin"; } else if ($r['user_level'] == 3) { $userl="Secretary"; } else if($r['user_level'] == 0) { $userl="NPC"; } else {$userl="Assistant"; }
$lon=($r['laston'] > 0) ?date('F j, Y g:i:s a',$r['laston']) : "Never";
$sup=date('F j, Y g:i:s a',$r['signedup']);
$ts=$r['strength']+$r['agility']+$r['guard']+$r['labour']+$r['IQ'];
$d="";
if($r['laston'] > 0)
{
$la=time()-$r['laston'];
$unit="seconds";
if($la >= 60)
{
$la=(int) ($la/60);
$unit="minutes";
}
if($la >= 60)
{
$la=(int) ($la/60);
$unit="hours";
if($la >= 24)
{
$la=(int) ($la/24);
$unit="days";
}
}
$str="$la $unit ago";
}
else
{
$str="--";
}
if($r['last_login'] > 0)
{
$ll=time()-$r['last_login'];
$unit2="seconds";
if($ll >= 60)
{
$ll=(int) ($ll/60);
$unit2="minutes";
}
if($ll >= 60)
{
$ll=(int) ($ll/60);
$unit2="hours";
if($ll >= 24)
{
$ll=(int) ($ll/24);
$unit2="days";
}
}
$str2="$ll $unit2 ago";
}
else
{
$str2="--";
}
print "Marital Status: ";
if ($r['marriage'])
{
$part=$db->query("SELECT * FROM users WHERE userid={$r['marriage']}");
$pr=$db->fetch_row($part);
print "Married to [url='viewuser.php?u={$pr[']{$pr['username']}[/url]";
}
else
{
print "Single";
}
print "
";
if($r['donatordays']) { $r['username'] = "<font color=red>{$r['username']}</font>";$d="[img=donator.gif]"; }
if($r['laston'] >= time()-15*60) { $on="<font color=green>[b]Online[/b]</font>"; } else { $on="<font color=red>[b]Offline[/b]</font>"; }
print "<left><table>
<tr>
<td>Name:</td>
<td>{$r['username']} [{$r['userid']}] $d</td>
</tr>
[img={$ir[]
<tr>
<td>User Level:</td>
<td>$userl</td>
</tr>
<tr>
<td>Duties:</td>
<td>{$r['duties']}</td>
</tr>
<tr>
<td>Gender:</td>
<td>{$r['gender']}</td>
</tr>
<tr>
<td>Days Old:</td>
<td>{$r['daysold']}</td>
</tr>
<tr>
<td>Last Action:</td>
<td>$str</td>
</tr>
<tr>
<td>Online:</td>
<td>$on</td>
</tr>
<tr>
<td>Location:</td>
<td>{$r['cityname']}</td>
</tr>
<tr>
<td>Property:</td>
<td>{$r['hNAME']}</td>
</tr>
<tr>
<td>Health:</td>
<td><img src=bar_left.gif height=13><img src=bargreen.gif width=$hpperc height=13><img src=barred.gif width=$hpopp height=13><img src=bar_fil_end.gif height=13></td>
</tr>
</table></left>
<table>
<tr>
<td>[[url='mailbox.php?action=compose&ID={$r[']Send Mail[/url]]</td>
</tr>
<tr>
<td>[[url='attack.php?ID={$r[']Attack[/url]]</td>
<td>[Faction:"; if($r['gang'])
{
print "[url='gangs.php?action=view&ID={$r[']{$r['gangNAME']}[/url]";
}
else
{
print "N/A]";
} print "</td>
</tr>
</table>";
if($ir['user_level'] == 2 || $ir['user_level'] == 3 || $ir['user_level'] == 5)
{
$r['lastiph']=@gethostbyaddr($r['lastip']);
$r['lastiph']=checkblank($r['lastiph']);
$r['lastip_loginh']=@gethostbyaddr($r['lastip_login']);
$r['lastip_loginh']=checkblank($r['lastip_loginh']);
$r['lastip_signuph']=@gethostbyaddr($r['lastip_signup']);
$r['lastip_signuph']=checkblank($r['lastip_signuph']);
print "<h3>Internet Info</h3><table width='100%' border='0' cellspacing='1' class='table'>
<tr><td></td><td class='h'>IP</td><td class='h'>Hostname</td></tr>
<tr><td class='h'>Last Hit</td><td>$r[lastip]</td><td>$r[lastiph]</td></tr>
<tr><td class='h'>Last Login</td><td>$r[lastip_login]</td><td>$r[lastip_loginh]</td></tr>
<tr><td class='h'>Signup</td><td>$r[lastip_signup]</td><td>$r[lastip_signuph]</td></tr></table>";
print "<form action='staffnotes.php' method='post'>
Staff Notes:
<textarea rows=7 cols=40 name='staffnotes'>{$r['staffnotes']}</textarea>
<input type='hidden' name='ID' value='{$_GET['u']}' />
<input type='submit' value='Change' /></form>";
}
else
{
print " ";
}
print "</tr></table>";
}
}
function checkblank($in)
{
if(!$in) { return "N/A"; }
return $in;
}
$h->endpage();
?>