Secret Experience

Secret Experience (https://secretexperience.net/index.php)
-   [L2J] Tutoriais (https://secretexperience.net/forumdisplay.php?f=39)
-   -   Status script com imagens (https://secretexperience.net/showthread.php?t=4991)

fetish 23-02-2009 08:08 PM

Status script com imagens
 
Tutorial explicativo de como criar um status script semelhante a esse:
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]

primeiro passo:

crie um arquivo chamado block.php


Citação:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>L2 status</title>
<?
// Edit IPs below
$loginIP = "localhost";
$gameIP = "localhost";
$gameIP1 = "localhost";
// Edit Ports if needed or add more
$loginPORT= "2106";
$gamePORT= "7777";
$gamePORT1= "7778";

?>
<style type="text/css">
<!--
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
body {
margin-left: 0px;
margin-top: 0px;
}
.style5 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; }
.style6 {font-size: 12px; font-weight: bold; }
-->
</style>
</head>

<body>
<table width="191" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="28" colspan="2" background="livestatus.png"><span class="style1"></span></td>
</tr>
<tr>
<td colspan="2"><span class="style1"></span></td>
</tr>
<tr>
<td width="89"><div align="right" class="style5">
<div align="right">Login:</div>
</div></td>
<td width="102"><div align="center" class="style6"><span class="style1">
<? error_reporting(0); $flogin = fsockopen ("$loginIP",$loginPORT, $errno, $errstr, 0);
if ($flogin)
{
print "<img src='offline.jpg'>";}
else
{ print "<img src='online.jpg'>";}?>
</span></div></td>
</tr>
<tr>
<td><div align="right" class="style5">
<div align="right">Gtest1:</div>
</div></td>
<td><div align="center" class="style6"><span class="style1">
<? error_reporting(0); $fgame = fsockopen ("$gameIP",$gamePORT, $errno, $errstr, 0);
if ($fgame){print "<img src='offline.jpg'>";}
else {print "<img src='online.jpg'>";}
?>
</span></div></td>
</tr>
<tr>
<td><div align="right" class="style5">
<div align="right">Gtest2:</div>
</div></td>
<td><div align="center" class="style6"><span class="style1">
<? error_reporting(0); $fgame = fsockopen ("$gameIP1",$gamePORT1, $errno, $errstr, 0);
if ($fgame){print "<img src='testing.png'>";}
else {print "<img src='online.jpg'>";}
?>
</span></div></td>
</tr>
<tr>
<td colspan="2"><span class="style1"></span></td>
</tr>
</table>
</body>
</html>
segundo passo:

configure o arquivo de acordo com as configurações do teu banco de dados.
Citação:

// Edite teus IPS abaixo
$loginIP = "localhost";
$gameIP = "localhost";
$gameIP1 = "localhost";
// Edite as portas aqui, ou se for necessário adicione mais.
$loginPORT= "2106";
$gamePORT= "7777";
$gamePORT1= "7778";
crie um iframe no teu site onde você quiser com o seguinte código

Citação:

<iframe allowtransparency="1" frameborder="0" height="140" name="status" src="block.php" marginwidth="10" width="191"></iframe>
nota: a imagens não aparecem transparentes no IE (internet "explosion"--') mas no firefox a vizualização é normal.


créditos: Near e Rwaver

dominyc 25-10-2009 09:52 PM

Muito bom pena que o codigo nao tem como copiar e digitar na munheca não rola. Mas vlw ae!

SaraxD 25-10-2009 10:27 PM

[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]

para facilitar escrevi tudin, espero q não atrapalhe so kiz ajudar *--*
:cute:


Horários baseados na GMT -3. Agora são 11:50 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.