Bonjour/bonsoir tout le monde =)

Alors voilà : j'utilise la librairie GD qui affiche, par exemple un serveur est online ou offline.

Donc j'ai mon script avec mon code GD :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
$char = file_get_contents("http://crow-online.com/status_image.php?type=char");
$map = file_get_contents("http://crow-online.com/status_image.php?type=map");
$login = file_get_contents("http://crow-online.com/status_image.php?type=login");
$ppl = file_get_contents("http://crow-online.com/status_image.php?type=ppl");
$max = file_get_contents("http://crow-online.com/status_image.php?type=max");
header('Content-type: image/jpeg');
$image = "satus.htm2.JPG";
$url = "http://crow-online.com";
$dune = "CroW - Customized Ragnarok Online World";
$im = imagecreatefromjpeg($image);
    $textcolor = imagecolorallocate($im, 255, 255, 255); 
    $textcolor2 = imagecolorallocate($im, 0, 0, 0);
    ImageString ($im, 5, 150, 10, $dune, $textcolor);
    ImageString ($im, 4, 110, 40, $login, $textcolor);
    ImageString ($im, 4, 110, 52, $char, $textcolor);
    ImageString ($im, 4, 110, 64, $map, $textcolor);
    ImageString ($im, 4, 110, 76, $ppl, $textcolor);
    ImageString ($im, 4, 110, 95, $max, $textcolor);
    ImageString ($im, 4, 2, 170, $url, $textcolor2);
Imagejpeg($im);
ImageDestroy ($im);
?>
Etle script avec les fonctions nécéssaire à ce que je veux faire de GD :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
<?php
 
 
//Adresse IP de votre server ragnarok
$ip='88.191.37.92';
 
//Port du Login-server
$lport=6900;
 
//Port du Char-server
$cport=6121;
 
//Port du Map-server
$mport=5121;
 
//Login
$account='Status';
 
//Pass
$passwd='server_img';
 
//Timeout
$timeout=2;
 
//Debug mode (1 pour oui, 0 pour non)
$debug=0;
 
 
function status_check($ip,$port,$timeout) {
 
//Verification du Status du Serveur
        $up = @fsockopen($ip,$port,$errno,$errstr,$timeout);
 
        if($up) {
return "ONLINE";
}
else {
return "OFFLINE";
}
 
 
        @fclose($up);
}
 
//Original fonction by [Devil] for AthenaAdvanced
//Edited by LebrEf for status script
function usronline($ip,$port,$account,$passwd,$timeout,$debug) {
 
if (!($fp = @fsockopen($ip,$port,$errno,$errstr,$timeout)))
{
if ($debug==1)  die( "Erreur 1");
 
else return "0";
}
else {
$in = pack("vVa24a24C",0x0064,9,$account,$passwd,3);
  fputs($fp, $in, strlen($in));
  fflush($fp);
  $assoc_array = unpack("vint", fread($fp,2));
 
if ( $assoc_array['int'] != 0x0069){
 
if ($debug==1)  die( "Erreur 2");
 
else return "0";
 
 
}
 
  $assoc_array = unpack("vint",fread($fp,2));
  $plen = ($assoc_array['int'] -= 4);
  fread($fp,43);
  $plen-=43;
  for (; $plen>0; $plen-=32){
  $assoc_array = unpack("x6/a20char/Vint",fread($fp,32));
  $name = $assoc_array['char'];
  //$name=substr($name,0,strpos($name,"\0")); // uncomment that line if you have more than one char server.
  $count = "".$assoc_array['int']."";
  return $count;
  }
  }
}
if($_GET['type'] == "login") {
$lol = 'Login Server : '.status_check($ip,$lport,$timeout);
echo $lol;
}
if($_GET['type'] == "char") {
$lol = 'Char Server : '.status_check($ip,$cport,$timeout);
echo $lol;
}
if($_GET['type'] == "map") {
$lol = 'Map Server : '.status_check($ip,$mport,$timeout);
echo $lol;
}
if($_GET['type'] == "ppl") {
$lol = 'Joueurs : '.usronline($ip,$lport,$account,$passwd,$timeout,$debug);
echo $lol;
} if($_GET['type'] == "max") {
if ($maxjoueur<.usronline($ip,$lport,$account,$passwd,$timeout,$debug)) { $maxjoueur=.usronline($ip,$lport,$account,$passwd,$timeout,$debug) }
$lol = 'Pax Joueurs Connecté : '$maxjoueur;
echo $lol;
}
?>
Donc le problème, c'est que dans le premier script, on voie l'adresse du script.
Et dans le deuxième script, j'ai un parse error à la ligne 103, donc à la fin

Donc merci de votre aide d'avance.


Cordialement,
Akenshiro.