PHP Code:
class rpgstats
{
function showstats($userid)
{
$question = $DB_site->query("
SELECT *
FROM inferno_user
WHERE rid = $userid
ORDER BY rid DESC
LIMIT 1
");
while($themember = $DB_site->fetch_array($question))
{
// Steal variables from Inferno ;)
$hp = $themember->hp;
$hpm = $themember->hpm;
$hpa = $hp/$hpm;
$hpa = $hpa*100;
$themember->hpd = $hpa;
$mp = $themember->mp;
$mpm = $themember->mpm;
$mpa = $mp/$mpm;
$mpa = $mpa*100;
$themember->mpd = $mpa;
$def = $themember->def;
$defm = $hpm;
$defa = $def/$defm;
$defa = $defa*100;
$themember->defd = $defa;
$str = $themember->str;
$strm = $hpm;
$stra = $str/$strm;
$stra = $stra*100;
$themember->strd = $stra;
if($themember->strd > 100)
{
$themember->strd=100;
}
if($themember->defd > 100)
{
$themember->defd=100;
}
$display[rpgdata] = "
<div class='userinfo' align='left'><img src='Inferno/bars/bar_red.gif' width='{$themember->hpd}%' height='16' alt='HP ({$themember->hp}/{$themember->hpm})'></div>
<div class='userinfo' align='left'><img src='Inferno/bars/bar_blue.gif' width='{$themember->mpd}%' height='16' alt='MP ({$themember->mp}/{$themember->mpm})'></div>
<div class='userinfo' align='left'><img src='Inferno/bars/bar_purple.gif' height='16' width='{$themember->strd}%' alt='STR ({$themember->str})'></div>
<div class='userinfo' align='left'><img src='Inferno/bars/bar_green.gif' height='16' width='{$themember->defd}%' alt='DEF ({$themember->def})'></div>
";
}
}
}
$rpg = $new_rpgstats;
try that