Файл: forum/img.php
Строк: 32
<?php
require_once '../sys/inc/start.php';
require_once '../sys/inc/settings.php';
require_once '../sys/inc/db_connect.php';
require_once '../sys/inc/ipua.php';
$set['antidos'] = 0;
require_once '../sys/inc/fnc.php';
require_once '../sys/inc/user.php';
if (!isset($_GET['p'])) {
exit;
}
$p = max(0, min(100, intval($_GET['p'])));
$k = max(0, intval($_GET['k']));
$a = max(0, intval($_GET['a']));
$x = 128;
$y = 10;
$x2 = intval($x / (100 / $p));
$img = imagecreate($x, $y);
$col['back'] = imagecolorallocate($img, 153, 188, 255);
$col['draw'] = imagecolorallocate($img, 122, 150, 204);
$col['font'] = imagecolorallocate($img, 0, 0, 0);
$col['border'] = imagecolorallocate($img, 155, 155, 155);
imagefill($img, $x, $y, $col['back']);
imagefilledrectangle($img, 0, 0, $x2, $y, $col['draw']);
imagerectangle($img, 0, 0, $x - 1, $y - 1, $col['border']);
imagestring($img, 1, $x / 10, 1, "$k/$a", $col['font']);
header("Content-type: image/png");
imagepng($img);