Ir para conteúdo
  • Cadastre-se
  • 0

HTM Rank para Site


Guilherme

Pergunta

3 respostass a esta questão

Posts recomendados

Bem, normalmente eu não posto scripts que eu uso, mas como eu ja ia posta-lo aqui abrirei uma excessão.

 

Crie um arquivo com o nome top.php e coloque isso nele:

<?

include "funcoes/config.php";

 

$conectar = mysql_connect($b_host,$b_login,$b_senha) or die(mysql_error());

mysql_select_db($banco,$conectar) or die(mysql_error());

$ordera = $_REQUEST['rank'];

 

if($ordera <> 'pvp' && $ordera <> 'pk' && $ordera <> 'olly' && $ordera <> 'hero' && $ordera <> 'siege' && $ordera <> 'online' && $ordera <> 'karma' && $ordera <> '')

{

$ordera = 'pvp';

}

 

 

$order = array("pvp" => "pvpkills",

"pk" => "pkkills",

"level" => "level",

"karma" => "karma",

"online" => "onlinetime",

);

$quantidade = 25;

if ($ordera == "online") $min = 86400;

else $min = 25;

$o = (isset($_GET['i'])) ? (int)$_GET['i'] : 1;

$inicio = ($quantidade * $o) - $quantidade;

$fim = $quantidade * $o;

$m = $quantidade / $o;

 

$ordem = empty($_GET["o"]) ? $order[$ordera] : base64_decode($_GET["o"]);

$qr = mysql_query("SELECT * FROM characters WHERE accesslevel = 0 and ".$ordem." >= ".$min." ORDER BY ".$ordem." DESC LIMIT ".$inicio.", ".$quantidade."") or die(mysql_error());

 

$array = array("pvpkills" => "PVP's",

"pkkills" => "PK's",

"level" => "Level",

"karma" => "Karma",

"onlinetime" => "Segundos",

);

 

$array2 = array("pvpkills" => "PVP",

"pkkills" => "PK",

"level" => "Level",

"karma" => "Karma",

"onlinetime" => "Online",

);

?>

<div class="png_bg" id="centro-topo">Top <?php echo $array2[$ordem]; ?><p><br>

 </div>

<table width="100%" class="TT">

<tr>

<td width="7%" align="center" bgcolor="#bcc4f2">#</td>

<td width="35%" align="center" bgcolor="#bcc4f2">Nome:</td>

<td width="15%" align="center" bgcolor="#bcc4f2"><?php echo $array[$ordem]; ?>:</td>

<td width="35%" align="center" bgcolor="#bcc4f2">Clan:</td>

</tr></table>

<?php

$to = $o-1;

$i = 1;

$soma = $i+$quantidade*$to;

if ($o >= 2) { $i = $soma; }

while($a = mysql_fetch_object($qr)) {

$clan = mysql_query("SELECT * FROM clan_data WHERE clan_id = '".$a->clanid."'") or die(mysql_error());

$clans = mysql_fetch_object($clan);

$clans->clan_name = empty($clans->clan_name) ? "No Clan." : $clans->clan_name;

$echo = number_format($a->$order[$ordera]);

?>

 

<table width="100%" border="0">

<tr>

<td width="7%" align="center"><? echo $i++; ?>º</td>

<td align="center" width="35%"><?php echo $a->char_name; ?></td>

<td align="center" width="15%"><?php echo $echo; ?></td>

<td align="center" width="35%"><?php echo $clans->clan_name; ?></td>

</tr></table>

<? } ?>

<div align="center"><br><br><br>

<hr />

<?

$sqlTotal = "SELECT * FROM characters WHERE accesslevel = 0 and ".$ordem." >= ".$min."";

$qrTotal = mysql_query($sqlTotal) or die(mysql_error());

$numTotal = mysql_num_rows($qrTotal);

if ($numTotal >= 1){

$totalo= ceil($numTotal/$quantidade);

for($i = 1; $i <= $totalo; $i++){

if($i == $o)

echo "<b>$i</b>";

else

echo " <a href=\"top.php?rank=$ordera&i=$i\">$i</a> ";

}}

else { echo "Não existem players para serem exibidos.";}

?>

<hr />

<a href="top.php?rank=pvp">Top PVP</a> | <a href="top.php?rank=pk">Top PK</a> | <a href="top.php?rank=online">Top Online</a> | <a href="top.php?rank=karma">Top Karma</a>

<br><a href="?page=hero">Heroes</a> | <a href="?page=olly">Olympiad</a> | <a href="?page=siege">Siege</a>

<hr />

</div>

 

No link coloque top.php?rank=pvp

mude onde está o ?rank=pvp para:

?rank=pk para ser top pk

?rank=pvp para ser top pvp

?rank=online para ser top online

?rank=karma para ser top karma

Editado por Rhion

"In a way, the supernatural is what's behind the curtain. Normally, you only need to see what's happening on stage. That's how reality works. If you don't know then it's for the best. Actually, learning about the supernatural only increases the number of things you don't know."'

Link para o comentário
Compartilhar em outros sites


Ative a opção short open tag do seu php ou substitua todos <? por <?php

"In a way, the supernatural is what's behind the curtain. Normally, you only need to see what's happening on stage. That's how reality works. If you don't know then it's for the best. Actually, learning about the supernatural only increases the number of things you don't know."'

Link para o comentário
Compartilhar em outros sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Processando...



×
×
  • Criar Novo...

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.