New Server Status Img

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Well I had nothing better to do, and I wanted a server status image so how does it look

x10free.png


I myself give it a 6/10, took me about 10 mins to do, but it works:).

Whats your rating/improvments I could make.
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Trixter said:
could you tell me how to making one of those?

Ya ill write something up later
 

Zenax

Active Member
Messages
1,377
Reaction score
4
Points
38
Yeah I would like to know too. Perhaps you should posta tutorial on it, if there isn't one already!

BTW: 7/10

Good looking, perhaps make the "Designed By Brandon" text smaller, so that it fits in easier.
 
Last edited:

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Here is the code I have.

PHP:
<?php
//------------------------------------------------------------------------
// PHP Enviromental's
ini_set('display_errors','0');
// PHP Enviromental's
//------------------------------------------------------------------------
// Check Port Function
function checkPort($ipAddress, $port) {
      $handle = @fsockopen($ipAddress, $port, $errno, $errstr,2);
      if ($handle == false) {
         return false;
      }
      else {
         return true;
      }
   }
// Check Port Function
header("Content-type: image/png");
$background = imagecreatefrompng('dfsafda98yf9yh9FDHG9DSHG9hgfdsgs.png');
$white = imagecolorallocate($background, 255, 255, 255);
$green = imagecolorallocate($background, 0, 64, 0);
$red = imagecolorallocate($background, 255, 124, 121);
$black = imagecolorallocate($background, 255, 255, 255);
imagettftext($background, 10, 0, 30, 56, $green, 'arial.ttf', '64.92.165.74');
// HTTP Only port 80
$status =  checkPort('64.92.165.74', 80);
   if ($status == true) {
      $data = 'Online';
      $color = $green;
   }
   else {
      $data = 'Offline';
      $color = $red;
   }

 // Checks the port
imagettftext($background, 10, 0, 47, 69, $color, 'arial.ttf', $data);
// HTTP Only port 80
// CPANEL Only port 2082
$status =  checkPort('64.92.165.74', 2082);
   if ($status == true) {
      $data = 'Online';
      $color = $green;
   }
   else {
      $data = 'Offline';
      $color = $red;
   }
imagettftext($background, 10, 0, 64, 135, $color, 'arial.ttf', $data);
//------------------------------------------------------------------------
// DNS Only port 53 
 // Checks the status of port 53
$status =  checkPort('64.92.165.74', 53);
   if ($status == true) {
      $data = 'Online';
      $color = $green;
   }
   else {
      $data = 'Offline';
      $color = $red;
   }
 // Checks the status of port 53

 //Writes the output
imagettftext($background, 10, 0, 38, 122, $color, 'arial.ttf', $data);
 //Writes the output
// DNS Only port 53
//------------------------------------------------------------------------
 // Checks the status of port 21
$status =  checkPort('64.92.165.74', 21);
   if ($status == true) {
      $data = 'Online';
      $color = $green;
   }
   else {
      $data = 'Offline';
      $color = $red;
   }
 // Checks the status of port 21

 // Writes the output
imagettftext($background, 10, 0, 39, 95, $color, 'arial.ttf', $data);
 // Writes the output
// FTP Only port 21
//------------------------------------------------------------------------
// MySQL Only port  3306
$status =  checkPort('64.92.165.74', 3306);
   if ($status == true) {
      $data = 'Online';
      $color = $green;
   }
   else {
      $data = 'Offline';
      $color = $red;
   }

imagettftext($background, 10, 0, 55, 109, $color, 'arial.ttf', $data);
// MySQL Only port  3306

//------------------------------------------------------------------------
// HTTPS Only port  443

 // Checks the status of port 21
$status =  checkPort('64.92.165.74', 443);
   if ($status == true) {
      $data = 'Online';
      $color = $green;
   }
   else {
      $data = 'Offline';
      $color = $red;
   }
 // Checks the status of port 21


imagettftext($background, 10, 0, 54, 81, $color, 'arial.ttf', $data);
// HTTPS Only port  443


//Makes and breaks the image
imagepng($background);
imagedestroy($background);
//Makes and breaks the image

?>

THats what I have.


imagettftext($background, 10, 0, 54, 81, $color, 'arial.ttf', $data);

that sets the x,y value were you can move it.

arial.ttf this is the font, to get a font copy it out of c:/windows/fonts/ to your destop and upoad it.

Edit: Ill work on a better one later, but i g2 take a shower and go to school:(
 
Last edited:

Fedlerner

Former Adm & Team Manager
Community Support
Messages
12,934
Reaction score
6
Points
38
Nice one man.
I like it, but the "Designed by Brandon" is cutted. I mean the "g" and the "y" are cutted.
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
fedlerner said:
Nice one man.
I like it, but the "Designed by Brandon" is cutted. I mean the "g" and the "y" are cutted.

ty, but like it said it was a quicky, im working on that extemded tutorial now, and should be ready in about 1-2 hours.
 

Derek

Community Support Force
Community Support
Messages
12,882
Reaction score
186
Points
63
yeha nice work 7.3/10 just more design thats allllllll
 

dest581

New Member
Messages
348
Reaction score
0
Points
0
Nice script. I think I'm going to "borrow" the server-checking code.

I love dynamic images. This reminds me to fix up an old script of mine.
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
I had a little problem over here with my computer, I should have the new tutorial done this weekend.
 

Derek

Community Support Force
Community Support
Messages
12,882
Reaction score
186
Points
63
didn't byron post one of these topics to make one aready
 

mgw854

New Member
Messages
36
Reaction score
0
Points
0
Certainly nice work, though I would update it with an XP/Vista theme instead of the old 98/Me/2000 Theme
 

HyDr@

New Member
Messages
268
Reaction score
0
Points
0
I would stick to this, the xp theme looks childish, this looks more technical.
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
mgw854 said:
Certainly nice work, though I would update it with an XP/Vista theme instead of the old 98/Me/2000 Theme

Lets see

Im running Windows 2000, there was no way to get an "xp" or "vista" theme.
 
Top