Jump to content

[SCRIPT]- Castle Siege - Simples e Bom.


Recommended Posts

Muitos ADM's ficam loucos atrás de um script para castle então vou postar um script simples.

 

CODIGO

 

<!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=utf-8" />
<style type="text/css">
#siege{width:500px; height:300px;}
.table {text-align:center; color:#000;}
.rowt{font-size:17px; font-weight:normal;color:#000; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif}
.row {font-size:15px;font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;}
a:hover {background:#ffffff; text-decoration:none;} /* background-color e necessario para o IE6 */
a.tooltip span {display:none; padding:2px 3px; margin-left:8px; width:auto;}
a.tooltip:hover span{display:inline; position:absolute; background:#000; border:1px solid #666; color:#FFF; text-align:justify; font-size:12px; font-weight:bold;}

*{
margin:0;
padding:0;
}

.text-cont {
text-align:center;
font-family:Tahoma, Geneva, sans-serif;
font-size:12px;
color:#000;
margin-top:10px;
margin-bottom:5px;
}

#barra_cont {
background:#0054a6;
width:600px;
height:35px;
margin-top:10px;
}

.titulo_cont {
text-align:center;
font-family:Tahoma, Geneva, sans-serif;
font-size:14px;
color:#FFF;
padding:10px;
}

.text-cont a {
color: #09F;
text-decoration:none;
}
.text-cont a:hover {
color:#06F;
}

</style>
</head>
<body>
<div id="barra_cont">
<div class="titulo_cont"># CASTLE SIEGE </div>
</div>
<div class="text-cont">
<center>
<div id="siege">
<table width="500px" border="0" align="center">
 <tr class="rowt" align="center" height="25">
<td>Castelo:</td>
<td>Clan:</td>
<td>Lord Castle:</td>
<td>Alliança:</td>
<td>Próxima Siege:</td>
</tr>
<?php
$db['servidor'] = "localhost";//IP do dedicado
$db['usuario_mysql'] = "root";// Usuario do mysql
$db['senha_mysql'] = "sua senha";//Senha do mysql
$db['banco_de_dados'] = "l2jdb";//Nome d banco de dados
$open = mysql_connect($db['servidor'], $db['usuario_mysql'], $db['senha_mysql']) or die("Não foi possível conectar-se à database.");
$select_db = mysql_select_db($db['banco_de_dados'], $open) or die("Database não encontrada ou inexistente.");
$sql = mysql_query("SELECT * FROM castle ORDER BY name") or die(mysql_error());
$cor = 0;
while($c = mysql_fetch_array($sql)) {
  $cor = $cor + 1;
  $bg  = $cor % 2 == 0 ? '#F1F1F1' : '#FFFFFF';

  $cl = mysql_query("SELECT * FROM clan_data WHERE hasCastle = '".$c['id']."'") or die(mysql_error());
  $clan = mysql_fetch_array($cl);

  $l = mysql_query("SELECT * FROM characters WHERE 'obj_id' = '".$clan['leader_id']."'") or die(mysql_error());
  $lord = mysql_fetch_array($l);

?>

 <tr bgcolor="<?php echo $bg; ?>" class="style8" align="center" height="23">
<td><a style="color:#000;text-decoration:none;" href="#" class="tooltip" ><?php echo $c['name']; ?><span>Castle Name: <font color="#FF9900"><?php echo $c['name'];?></font><br />Tax Percent: <font color="#FF9900"><?php echo $c['taxPercent']."%"; ?></font></span> </a></td>
<td><?php echo !empty($clan['clan_name']) ? $clan['clan_name'] : "No Clan"; ?></td>
<td><?php echo !empty($lord['char_name']) ? $lord['char_name'] : "No Lord"; ?></td>
<td><?php echo !empty($clan['ally_name']) ? $clan['ally_name'] : "No Ally"; ?></td>
<td><?php echo @date('D\, j M Y H\:i',$c['siegeDate']/1000); ?></td>
 </tr>
<?php
}
?>
</table>
</div>
</center>
</div>
</body>
</html>

 

 

IMAGEM

 

castleu.gif

 

 

CREDITOS

 

Script Desenvolvido por: Jonatha ferreira.

 

  • Like 2
Link to comment
Share on other sites


Salvo eu mesmo vou lançar ele em meu Web que estou desenvolvendo rs, Só força ai .

 

////EDIT

 

 

marcosalberto

 

 

Cuidado ai amigo tu pode ser alertado Usa o Botão editar, ;D

Edited by -Zero3Um-

''Junte-se a nós para recuperarmos os Links Offline''

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.