Bem pessoal, depois de ter formatado o meu pc, n tenho quase nada instalado. Por isso uma judinha dava-me mt jeito.
Eu tenho um script, editado por mim, para mostrar o status dum server.
O que eu queria e que o ppl me desse uma ajudinha a mudar o Online e offline para o topo da imagem, centrado
e se possivel me indicassem uma fonte fixe e um tamanho ideal... lol e tambem a melhor cor
E me dessem isso, editando o codigo... Uma vez k e a minha primeira vez que faço uma imagem usando php...
Esta é a imagem de base:
Esta é a imgaem de status:
Este é o script:
<?php
//==================================================================
// A header to show that this is an image of PNG format
//==================================================================
header("Content-type: image/png");
//==================================================================
// Not sure if these are needed. Comment out if this script
// slows down your server.
//==================================================================
ini_set("max_execution_time",0);
ini_set("default_socket_timeout",5);
//==================================================================
// Server URL or Name (ex: AnotherScape.ServeGame.com)
//==================================================================
$server = "RSTuga.servegame.com";
//==================================================================
// Actual server URL (ex: anotherscape.servegame.com, 127.0.0.1)
// THE EXACT URL OR IP ADDRESS
//==================================================================
$server_url = "rstuga.servegame.com";
//==================================================================
// The server port. Usually 43594
//==================================================================
$server_port = 43594;
//=================================================================
// Load the base image to place our text on
//=================================================================
$base = imagecreatefrompng("base.png");
//=================================================================
// Create the color black, which will be used for our shadow
//=================================================================
$black = imagecolorallocate($base, 0, 0, 0);
//=================================================================
// The filename of our TTF font
//=================================================================
$font = "18thCentury.ttf";
/****************************************************
* Our image stuff is mostly done. *
* Now we need to determine the server status *
****************************************************/
if (!$socket = @fsockopen($server_url,$server_port, $errno, $errstr, 7))
{
//============================================================
// Our status from the socket
//============================================================
$status = "Server is Offline";
//============================================================
// Our status color, which in this case is red
//============================================================
$status_color = imagecolorallocate($base, 194, 7, 7);
} else {
//============================================================
// Pretty much the opposite from above code. Color is green
//============================================================
$status = "Server is Online!";
$status_color = imagecolorallocate($base, 53, 147, 7);
}
/****************************************************
* Now that we have our precious server status *
* we need to create the text for that. *
****************************************************/
//=================================================================
// Create our shadow for the Server URL/Name
//=================================================================
imagettftext($base, 20, 0, 47, 47, $black, $font, $status);
//=================================================================
// Create our main text for the Server URL/Name
//=================================================================
imagettftext($base, 20, 0, 45, 45, $status_color, $font, $status);
//=================================================================
// Send out the image, and destroy it (ironic, eh?)
//=================================================================
imagepng($base);
imagedestroy($base);
//=================================================================
// And you're done!
//=================================================================
?>
Eu cortei algumas coisas pk a unica coisa que quero e a dizer se esta online ou offline
Obrigado ppl se me ajudaram