// get join date & posts per day
$jointime = (TIMENOW - $post['joindate']) / 86400; // Days Joined
if ($jointime < 1)
{ // User has been a member for less than one day.
$postsperday = $post['posts'];
}
else
{
$postsperday = vb_number_format($post['posts'] / $jointime, 2);
}
$post['joindate'] = vbdate($vboptions['registereddateformat'], $post['joindate']);
$startcounting = $DB_site->query_first("SELECT COUNT(postuserid) AS startcounting FROM " . TABLE_PREFIX . "thread WHERE postusername='" .addslashes($post[username]). "' AND open!='10'");
$sujetscres = $startcounting['startcounting'];
if($sujetscres == 0)
{
$pourcent = 0;
}
else
{
$pourcent = sprintf("%.2f",(($startcounting['startcounting'] / $post['posts']) * 100));
}
// format posts number
$post['posts'] = vb_number_format($post['posts']);
//hack level par akex -
http://forum.vbulletin-france.com
if ($post[posts]) {
$niveau="0";
$experience_aft="0";
$experience_bef="0";
while ($experience_aft<=$post[posts]) {
$experience_bef+=10*pow($niveau,2);
$niveau++;
$experience_aft+=10*pow($niveau,2);
}
$post[exp]=$post[posts];
$post[perexp]=floor(100*($post[exp]-$experience_bef)/($experience_aft-$experience_bef));
$post[perexp1]=100-$post[perexp];
$post[exp_max]=$experience_aft;
$post[niveau]=$niveau;
$post[hp_max]=$post[niveau]*50;
$post[mp_max]=$post[niveau]*20;
$experience_bef= iif($experience_bef>0, $experience_bef-1, '0');
$derposts=$DB_site->query("
SELECT dateline FROM " . TABLE_PREFIX . "post where userid=$post[userid] order by dateline asc limit $experience_bef, 18446744073709551615
");