Файл: vtulun.ru/static.php
Строк: 31
<?
if (!isset($_GET['p']))exit;
$p=max(0,min(99999999,intval($_GET['p'])));
$x=90;
$y=15;
if ($p<=100)
{
$x2=@intval($x/(100/$p));
$img=imagecreate($x,$y);
$col['back']=imagecolorallocate($img, 135,206,255);
$col['draw']=imagecolorallocate($img, 108,166,205);
$col['font']=imagecolorallocate($img, 16,78,139);
$col['border']=imagecolorallocate($img, 16,78,139);
imagefill($img, $x, $y, $col['back']);
imagefilledrectangle($img, 0, 0, $x2, $y, $col['draw']);
imagerectangle($img, 0, 0, $x-1, $y-1, $col['border']);
imagettftext ($img, 8, 0, $x/10, $y-2, $col['font'], 'sys/fonts/tahoma.ttf', "Рейтинг: $p %");
}
elseif ($p>100 && $p<=300)
{
$x2=@intval($x/(300/$p));
$img=imagecreate($x,$y);
$col['back']=imagecolorallocate($img, 135,206,255);
$col['draw']=imagecolorallocate($img, 108,166,205);
$col['font']=imagecolorallocate($img, 16,78,139);
$col['border']=imagecolorallocate($img, 16,78,139);
imagefill($img, $x, $y, $col['back']);
imagefilledrectangle($img, 0, 0, $x2, $y, $col['draw']);
imagerectangle($img, 0, 0, $x-1, $y-1, $col['border']);
imagettftext ($img, 8, 0, $x/10, $y-2, $col['font'], 'sys/fonts/tahoma.ttf', "Рейтинг: $p %");
}
elseif ($p>300)
{
$x2=@intval($x/(3000/$p));
$img=imagecreate($x,$y);
$col['back']=imagecolorallocate($img, 225,204,126);
$col['draw']=imagecolorallocate($img, 203,180,100);
$col['font']=imagecolorallocate($img, 88,88,88);
$col['border']=imagecolorallocate($img, 178,159,78);
imagefill($img, $x, $y, $col['back']);
imagefilledrectangle($img, 0, 0, $x2, $y, $col['draw']);
imagerectangle($img, 0, 0, $x-1, $y-1, $col['border']);
imagettftext ($img, 8, 0, $x/10, $y-2, $col['font'], 'sys/fonts/tahoma.ttf', "Рейтинг: $p %");
}
elseif ($p>3000)
{
$x2=@intval($x/(4000/$p));
$img=imagecreate($x,$y);
$col['back']=imagecolorallocate($img, 225,204,126);
$col['draw']=imagecolorallocate($img, 203,180,100);
$col['font']=imagecolorallocate($img, 88,88,88);
$col['border']=imagecolorallocate($img, 178,159,78);
imagefill($img, $x, $y, $col['back']);
imagefilledrectangle($img, 0, 0, $x2, $y, $col['draw']);
imagerectangle($img, 0, 0, $x-1, $y-1, $col['border']);
imagettftext ($img, 8, 0, $x/10, $y-2, $col['font'], 'sys/fonts/tahoma.ttf', "Рейтинг: $p %");
}
header("Content-type: image/png");
imagepng($img);
?>