2012-11-03 22:45:03 -04:00
|
|
|
<?php
|
|
|
|
|
2013-03-05 00:22:17 -05:00
|
|
|
include_once(__DIR__ . '/libs/stats.php');
|
|
|
|
include_once(__DIR__ . '/libs/diabloclass.php');
|
2012-11-03 22:45:03 -04:00
|
|
|
|
|
|
|
if($_POST['submit']) {
|
|
|
|
$diabloProgressUrl = trim($_POST['url']);
|
2012-11-30 00:01:52 -05:00
|
|
|
if(preg_match('{^http://www.diabloprogress.com/hero/.*\-[\d]+/.*/[\d]+$}', $diabloProgressUrl) != 1) {
|
2012-11-03 22:45:03 -04:00
|
|
|
die('Bad URL. Please enter the entire diablo progress URL.<br/><br/>Example: http://www.diabloprogress.com/hero/celanian-1548/HsuMing/21706367');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-03-05 00:22:17 -05:00
|
|
|
$stats = StatsFactory::createStatsObject($diabloProgressUrl);
|
|
|
|
|
|
|
|
if($stats === FALSE) {
|
|
|
|
die('Bad provider. Either your provider could not be detected or we do not support your provider at this time.');
|
|
|
|
}
|
|
|
|
|
2013-04-08 18:44:04 -04:00
|
|
|
$character = DiabloClassFactory::createClassObject($stats->class, $stats, 'pvp');
|
2012-11-03 22:45:03 -04:00
|
|
|
|
|
|
|
if($character === FALSE) {
|
|
|
|
die('Bad class. Either your class could not be detected or we do not support your class at this time.');
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<hr/>
|
2012-11-26 02:16:12 -05:00
|
|
|
<b>Hall Score: <?php echo number_format($character->hallScore(), 2, '.', ','); ?></b><br/><br/>
|
2012-11-03 22:45:03 -04:00
|
|
|
|
2012-11-26 02:16:12 -05:00
|
|
|
DPS Score: <?php echo number_format($character->DPSScore(), 2, '.', ','); ?><br/>
|
|
|
|
EHP Score: <?php echo number_format($character->EHPScore(), 2, '.', ','); ?><br/>
|
|
|
|
Sustain Score: <?php echo number_format($character->sustainScore(), 2, '.', ','); ?><br/>
|
|
|
|
Move Score: <?php echo number_format($character->moveScore(), 2, '.', ','); ?><br/>
|
|
|
|
Paragon Score: <?php echo number_format($character->paragonScore(), 2, '.', ','); ?><br/>
|
2012-12-03 14:03:26 -05:00
|
|
|
Misc Score: <?php echo number_format($character->miscScore(), 2, '.', ','); ?><br/>
|
2012-11-03 22:45:03 -04:00
|
|
|
<hr/>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<form method="POST">
|
|
|
|
D3 Progress URL: <input type="text" name="url" style="width:500px;" value="<?php echo $diabloProgressUrl ?>" /><br />
|
|
|
|
<input type="submit" name="submit" />
|
|
|
|
</form>
|