$boxHeightModifier = 0; $positionWidthModifier = 0; // Check to see if there are stats if (!$stype) { $boxHeightModifier = -113; } // Check to see if position uses two characters if ($row["pos"][1]) { $positionWidthModifier = 50; } if ($row["pos"][0] == 'W') { $positionWidthModifier += 20; } $canvas = new Imagick(); $canvas->newImage(1920, 1080, "none", "png"); blackbox($canvas, 400, 870 - $boxHeightModifier, 1120, 160 + $boxHeightModifier); slantRectangle($canvas, 360, 800 - $boxHeightModifier, 780, 80, $tColor); slantRectangle($canvas, 1100 - $positionWidthModifier, 800 - $boxHeightModifier, 150, 80, "#303030"); slantRectangle($canvas, 1210 - $positionWidthModifier, 800 - $boxHeightModifier, 130 + $positionWidthModifier, 80, $tColor); slantRectangle($canvas, 1300, 800 - $boxHeightModifier, 140, 80, "#303030"); slantRectangle($canvas, 1400, 800 - $boxHeightModifier, 160, 80, "white"); $pPath = "teams/" . $row["team"] . "imgs/" . $row["first"] . $row["last"] . ".png"; $size = @getimagesize($pPath); $nameModifier = 0; $detailsModifier = 0; if ($size[0]) { $pW = 192; $pH = 230; $pX = 400; $pY = 801; if ($size[0] * 1.2 > $size[1]) {
function blackboxpart($title, $pos, $extra = '') { $data = blackbox($title, '%code', 1, true, 'box', 'left', 0, $extra); $p = strpos($data, '%code'); if ($p !== false) { if ($pos == 1) { return substr($data, 0, $p); } else { return substr($data, $p + 5); } } }
$boxHeightModifier = -113; } // Check to see if position uses two characters if ($row["pos"][1]) { $positionWidthModifier = 50; } if ($row["pos"][0] == 'W') { $positionWidthModifier += 20; } $blackBox = new Imagick(); $blackBox->newImage(1150, 190, "none", "png"); $mainBar = new Imagick(); $mainBar->newImage(1230, 110, "none", "png"); $logoBox = new Imagick(); $logoBox->newImage(190, 110, "none", "png"); blackbox($blackBox, array('x' => 10, 'y' => 10, 'w' => 1120, 'h' => 160 + $boxHeightModifier)); slantRectangle($mainBar, array('x' => 10, 'y' => 10, 'w' => 780, 'h' => 80, 'color' => $tColor)); slantRectangle($mainBar, array('x' => 750 - $positionWidthModifier, 'y' => 10, 'w' => 150, 'h' => 80, 'color' => "#303030")); slantRectangle($mainBar, array('x' => 860 - $positionWidthModifier, 'y' => 10, 'w' => 130 + $positionWidthModifier, 'h' => 80, 'color' => $tColor)); slantRectangle($mainBar, array('x' => 950, 'y' => 10, 'w' => 140, 'h' => 80, 'color' => "#303030")); slantRectangle($mainBar, array('x' => 1050, 'y' => 10, 'w' => 160, 'h' => 80, 'color' => "white")); slantRectangle($logoBox, array('x' => 10, 'y' => 10, 'w' => 160, 'h' => 80, 'color' => "white")); $pPath = "teams/" . $row["team"] . "imgs/" . $row["first"] . $row["last"] . ".png"; $size = @getimagesize($pPath); $nameModifier = 0; $detailsModifier = 0; $p = null; if ($size[0]) { $p = array('w' => 192, 'h' => 230, 'x' => 400, 'y' => '801', 'path' => $pPath); if ($size[0] * 1.2 > $size[1]) { $p['h'] = $size[1] / ($size[0] / $p['w']);