forked from Th3-822/rapidleech
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbar.php
More file actions
29 lines (29 loc) · 984 Bytes
/
Copy pathbar.php
File metadata and controls
29 lines (29 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
error_reporting(0);
function drawRating() {
$width = $_GET['width'];
$height = $_GET['height'];
if ($width == 0) {
$width = 200;
}
if ($height == 0) {
$height = 7;
}
$rating = $_GET['rating'];
$ratingbar = (($rating/100)*$width)-2;
$image = imagecreate($width,$height);
$fill = ImageColorAllocate($image,0,255,0);
if ($rating > 49) { $fill = ImageColorAllocate($image,255,255,0); }
if ($rating > 74) { $fill = ImageColorAllocate($image,255,128,0); }
if ($rating > 89) { $fill = ImageColorAllocate($image,255,0,0); }
$back = ImageColorAllocate($image,205,205,205);
$border = ImageColorAllocate($image,0,0,0);
ImageFilledRectangle($image,0,0,$width-1,$height-1,$back);
ImageFilledRectangle($image,1,1,$ratingbar,$height-1,$fill);
ImageRectangle($image,0,0,$width-1,$height-1,$border);
imagePNG($image);
imagedestroy($image);
}
Header("Content-type: image/png");
drawRating();
?>