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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
| <?
$image_width=60;
$image_heigth=60;
//$bestand = "http://stats.wilc0.com/new/userinfo.php?name=Nakebod";
$bestand = "stats.dat";
$fp = fopen($bestand, "r");
$inhoud = fread($fp, 250);
$stats = explode("\n", $inhoud);
if (count(stats) < 1)
{
die('No data');
}
$nickname = $stats[0];
$country = $stats[1];
$subteam = $stats[2];
$overall_credit_individueel = $stats[3];
$daily_credit_individueel = $stats[4];
$overall_credit_subteam = $stats[5];
$daily_credit_subteam = $stats[6];
$overall_pos_subteam = $stats[7];
$daily_pos_subteam = $stats[8];
$overall_pos_in_subteam = $stats[9];
$daily_pos_in_subteam = $stats[10];
$perc_in_subteam_overall = $stats[11];
$perc_in_subteam_daily = $stats[12];
$perc_subteam_DPC_overall = $stats[13];
$perc_subteam_DPC_daily = $stats[14];
$credit_total = (int)$overall_credit_individueel;
$credit_today = (int)$daily_credit_individueel;
$perc_today = round($perc_subteam_DPC_daily, 2);
$perc_total = round($perc_subteam_DPC_overall, 2);
$font = "/home/sander/Fonts/verdanab.ttf";
// create and draw first image ($img1)
$img1 = imageCreate($image_width,$image_heigth);
// The first color is always the background color.
$black = imageColorAllocate($img1, 0, 0, 0);
$gray = imageColorAllocate($img1, 128,128,128);
$white = imageColorAllocate($img1, 255, 255, 255);
ImageTTFText($img1, 6,0,4,10,$gray,$font,"Stats Today");
ImageTTFText($img1, 8,0,10,23,$white,$font,"$credit_today");
ImageTTFText($img1, 8,0,10,34,$white,$font,"#$daily_pos_subteam");
ImageTTFText($img1, 8,0,10,45,$white,$font,"$perc_today%");
ImageTTFText($img1, 8,0,18,57, $gray, $font ,"R@h");
$img2 = imageCreate($image_width,$image_heigth);
$black = imageColorAllocate($img2, 0, 0, 0); //first one is allways background
$gray = imageColorAllocate($img2, 128,128,128);
$white = imageColorAllocate($img2, 255, 255, 255);
ImageTTFText($img2, 6,0,4,10,$gray,$font,"Stats Total");
ImageTTFText($img2, 8,0,10,23,$white,$font,"$credit_total");
ImageTTFText($img2, 8,0,10,34,$white,$font,"#$overall_pos_subteam");
ImageTTFText($img2, 8,0,10,45,$white,$font,"$perc_total%");
ImageTTFText($img2, 8,0,18,57, $gray, $font ,"R@h");
$img3 = imageCreate($image_width,$image_heigth);
$black = imageColorAllocate($img3, 0, 0, 0); //first one is allways background
$red = imageColorAllocate($img3, 255,0,0);
ImageTTFText($img3, 32,0,12,46,$red,$font,"D");
$img4 = imageCreate($image_width,$image_heigth);
$black = imageColorAllocate($img4, 0, 0, 0); //first one is allways background
$white = imageColorAllocate($img4, 255, 255, 255);
ImageTTFText($img4, 32,0,12,46,$white,$font,"P");
$img5 = imageCreate($image_width,$image_heigth);
$black = imageColorAllocate($img5, 0, 0, 0); //first one is allways background
$blue = imageColorAllocate($img5, 0,0,255);
ImageTTFText($img5, 32,0,12,46,$blue,$font,"C");
$img6 = imageCreate($image_width,$image_heigth);
$black = imageColorAllocate($img6, 0, 0, 0); //first one is allways background
$gray = imageColorAllocate($img6, 128,128,128);
$white = imageColorAllocate($img6, 255, 255, 255);
$red = imageColorAllocate($img6, 255,0,0);
$blue = imageColorAllocate($img6, 0,0,255);
ImageTTFText($img6, 10,0,15,13, $gray , $font,"Join");
ImageTTFText($img6, 19,0,1,39, $red , $font,"D");
ImageTTFText($img6, 19,0,21,39, $white, $font,"P");
ImageTTFText($img6, 19,0,40,39, $blue , $font,"C");
ImageTTFText($img6, 12,0,11,55, $gray, $font ,"R@h");
$img7 = ImageCreateFromPNG ("DPC.png");
// Include the magic stuff
include("image_anigif.php");
$gif = new animatedGif($img1,200);
$gif->addImage($img2,200);
$gif->addImage($img3,25);
$gif->addImage($img4,25);
$gif->addImage($img5,25);
$gif->addImage($img6,150);
$gif->addImage($img7,100);
// add as many images as you like...
$gifdata = $gif->Generate(0,"Nakebods stats");
// output to browser
header("Content-type: image/gif;");
echo $gifdata;
// cleanup
imageDestroy($img1);
imageDestroy($img2);
imageDestroy($img3);
imageDestroy($img4);
imageDestroy($img5);
imageDestroy($img6);
imageDestroy($img7);
?> |