Bugs


Name getlevel() >= level 18
Description The function getlevel() to calculate the level and percent by trophies seems to calc wrong >= level 18.


<?
// Get Level (and percent) by Platinum, Gold, Silver and Bronze
// Based on: http://boardsus.playstation.com/playstation/board/message?message.uid=37889341
function getlevel($pl,$go,$si,$br) {
   
$points = $pl*180+$go*90+$si*30+$br*15; $p=0;
   for (
$x=1;$points>=$p;$x++) {
       
$l=$p;
       switch (
$x) {
           case
1:$y=1;break; case 2:$p=200;break; case 3:$p*=3;break;
           case
4:$p*=2;break; case 5:$p*=2;break; case 6:$p+=$p*2/3;break;
           default:
$n=$x-$y*6+1; $p+=$p*1/$n; if ($n==7) { $y++; }
       }
       if (
$points <= $p) { return $x+substr(($points-$l)/($p-$l),0,4)-1; }
   }
   return
0;
}
?>


Reported PSN-IDs:
- PortlandRidah
Project GetInfos
Create Date 2009-08-24
Created by Geekathome
Priority (0=>less, 10=>highest) 1
State Open
Projects
$_COM
$_ORG
GetAuthData
GetId
GetInfos
psnapi.org at ...
Folding@Home: 193066
IRC (freenode): #psnapi
PS Home (Club): api
Others
API Statistics (live)
Newest members (3)
HomeOnline
OzyMaximus
thp44
Online now
0 Members
Support us