syntax cleanup

This commit is contained in:
2017-10-22 20:39:20 -07:00
parent bb1051e490
commit 3729258931
109 changed files with 847 additions and 1641 deletions
+26 -46
View File
@@ -8,61 +8,53 @@ $black = imageColorAllocate ($im, 0, 0, 0);
imageFill($im, 5, 5, $black);
*/
include("config.php");
function makestatimage($pid) {
global $con;
global $con;
$result = mysql_query("SELECT * FROM mrpg_stat WHERE id='$pid'");
$row = mysql_fetch_array($result);
$result = mysql_query("SELECT * FROM mrpg_stat WHERE id='$pid'");
$row = mysql_fetch_array($result);
$im=imageCreateTrueColor(470, 329);
$white=imageColorAllocate ($im, 255, 255, 255);
$red=imageColorAllocate ($im, 255, 0, 0);
$green=imageColorAllocate ($im, 0, 255, 0);
$black = imageColorAllocate ($im, 0, 0, 0);
imageFill($im, 5, 5, $black);
$im=imageCreateTrueColor(470, 329);
$white=imageColorAllocate ($im, 255, 255, 255);
$red=imageColorAllocate ($im, 255, 0, 0);
$green=imageColorAllocate ($im, 0, 255, 0);
$black = imageColorAllocate ($im, 0, 0, 0);
imageFill($im, 5, 5, $black);
imageString($im, 4, 50, 100, "PP: " . $row['pp'], $white);
imageString($im, 4, 50, 140, "Offense: " . $row['offense'], $white);
imageString($im, 4, 50, 180, "Defense: " . $row['defense'], $white);
imageString($im, 4, 50, 220, "Fight: " . $row['fight'], $white);
imageString($im, 4, 50, 100, "PP: " . $row['pp'], $white);
imageString($im, 4, 50, 140, "Offense: " . $row['offense'], $white);
imageString($im, 4, 50, 180, "Defense: " . $row['defense'], $white);
imageString($im, 4, 50, 220, "Fight: " . $row['fight'], $white);
imageString($im, 4, 340, 100, "Speed: " . $row['speed'], $white);
imageString($im, 4, 340, 140, "Wisdom: " . $row['wisdom'], $white);
imageString($im, 4, 340, 180, "Strength: " . $row['strength'], $white);
imageString($im, 4, 340, 220, "Force: " . $row['force'], $white);
imageString($im, 4, 340, 100, "Speed: " . $row['speed'], $white);
imageString($im, 4, 340, 140, "Wisdom: " . $row['wisdom'], $white);
imageString($im, 4, 340, 180, "Strength: " . $row['strength'], $white);
imageString($im, 4, 340, 220, "Force: " . $row['force'], $white);
$barw=round(($row['hp'] / $row['maxhp'])*370);
$barw=round(($row['hp'] / $row['maxhp'])*370);
imageFilledRectangle($im, 50, 30, 420, 70, $red);
imageFilledRectangle($im, 50, 30, 50+$barw, 70, $green);
imageRectangle($im, 50, 30, 420, 70, $white);
imageFilledRectangle($im, 50, 30, 420, 70, $red);
imageFilledRectangle($im, 50, 30, 50+$barw, 70, $green);
imageRectangle($im, 50, 30, 420, 70, $white);
imageString($im, 5, 210, 10, "HP: " . $row['hp'], $green);
imageString($im, 5, 210, 10, "HP: " . $row['hp'], $green);
header('Content-type: image/png');
imagePNG($im);
imageDestroy($im);
header('Content-type: image/png');
imagePNG($im);
imageDestroy($im);
}
makestatimage(1);
/*
$background = imageColorAllocate ($im, 255, 255, 255);
$background = imageColorTransparent($im,$background);
@@ -84,16 +76,4 @@ $x=$x+16;
}*/
?>
?>