Ir para conteúdo
  • 0

Mostrar apenas 25 premiados! Ajudinha!


raynerjr

Pergunta

Minha loteria esta mostrando todo mundo que ganha, final da historia fica uma lista enorme no site!

Gostaria que mostra-se apenas os 25 primeiros ganhadores!

 

lottery.php

 

 

<?PHP 
$main_content .= '<center><h1>Loteria da Sorte</h1><h3>Loteria da os seguintes premios abaixo à cada 1 hora de jogo</h3></center>
<table>
  <tr>
    <th><center>5 Crystal Coin</center></th>
    <th><center>Amulet of Loss</center></th>
    <th><center>Boots of Haste</center></th>
    <th><center>Mystic Blade</center></th>
    <th><center>Cranial Basher</center></th>
    <th><center>Heroic Axe</center></th>
    <th><center>Underworld Rod</center></th>
    <th><center>Wand of Voodoo</center></th>
    <th><center>Vampire Shield</center></th>
    <th><center>Crystal of Update</center></th>
  </tr>
  <tr>
    <td><center><img src="images/loteria/crystal+coin.gif"></center></td>
    <td><center><img src="images/loteria/amulet+of+loss.gif"></center></td>
    <td><center><img src="images/loteria/boots+of+haste.gif"></center></td>
    <td><center><img src="images/loteria/mystic+blade.gif"></center></td>
    <td><center><img src="images/loteria/cranial+basher.gif"></center></td>
    <td><center><img src="images/loteria/heroic+axe.gif"></center></td>
    <td><center><img src="images/loteria/underworld+rod.gif"></center></td>
    <td><center><img src="images/loteria/wand+of+voodoo.gif"></center></td>
    <td><center><img src="images/loteria/vampire+shield.gif"></center></td>
    <td><center><img src="images/loteria/crystal+of+upgrade.gif"></center></td>
  </tr>
</table></table><table><br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr BGCOLOR="'.$config['site']['vdarkborder'].'"><td CLASS=white><center><b>Jogador</b></center></td><td CLASS=white width=184 colspan=2><center><b>Premio</b></center></td><td width=100 CLASS=white><center><b>Server</b></center></td></tr>'; 
$lottery = $SQL->query('SELECT id, name, item, world_id FROM lottery WHERE world_id = 0 ORDER BY id DESC;'); 
foreach($lottery as $result) { 
 $players++; 
            if(is_int($players / 2)) 
                $bgcolor = $config['site']['lightborder']; 
            else 
                $bgcolor = $config['site']['darkborder']; 


$main_content .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=35%><center><a href="?subtopic=characters&name='.urlencode($result['name']).'">'.$result['name'].'</a></center></td><TD WIDTH=5%><img src=\'images/loteria/'.urlencode($result['item']).'.gif\'></td><TD WIDTH=30%><b>'.$result['item'].'</b></td><TD WIDTH=30%><center>BAIAK</center></td></tr>'; 
} 
$main_content .= '</table>'; 
?>

 

 

 

Obrigado!

 

Editado por raynerjr
Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

@@raynerjr, testa ai:

 

 

<?PHP 
$main_content .= '<center><h1>Loteria da Sorte</h1><h3>Loteria da os seguintes premios abaixo à cada 1 hora de jogo</h3></center>
<table>
  <tr>
    <th><center>5 Crystal Coin</center></th>
    <th><center>Amulet of Loss</center></th>
    <th><center>Boots of Haste</center></th>
    <th><center>Mystic Blade</center></th>
    <th><center>Cranial Basher</center></th>
    <th><center>Heroic Axe</center></th>
    <th><center>Underworld Rod</center></th>
    <th><center>Wand of Voodoo</center></th>
    <th><center>Vampire Shield</center></th>
    <th><center>Crystal of Update</center></th>
  </tr>
  <tr>
    <td><center><img src="images/loteria/crystal+coin.gif"></center></td>
    <td><center><img src="images/loteria/amulet+of+loss.gif"></center></td>
    <td><center><img src="images/loteria/boots+of+haste.gif"></center></td>
    <td><center><img src="images/loteria/mystic+blade.gif"></center></td>
    <td><center><img src="images/loteria/cranial+basher.gif"></center></td>
    <td><center><img src="images/loteria/heroic+axe.gif"></center></td>
    <td><center><img src="images/loteria/underworld+rod.gif"></center></td>
    <td><center><img src="images/loteria/wand+of+voodoo.gif"></center></td>
    <td><center><img src="images/loteria/vampire+shield.gif"></center></td>
    <td><center><img src="images/loteria/crystal+of+upgrade.gif"></center></td>
  </tr>
</table></table><table><br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr BGCOLOR="'.$config['site']['vdarkborder'].'"><td CLASS=white><center><b>Jogador</b></center></td><td CLASS=white width=184 colspan=2><center><b>Premio</b></center></td><td width=100 CLASS=white><center><b>Server</b></center></td></tr>'; 
$lottery = $SQL->query('SELECT id, name, item, world_id FROM lottery WHERE world_id = 0 ORDER BY id DESC LIMIT 25;'); 
foreach($lottery as $result) { 
 $players++; 
            if(is_int($players / 2)) 
                $bgcolor = $config['site']['lightborder']; 
            else 
                $bgcolor = $config['site']['darkborder']; 


$main_content .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=35%><center><a href="?subtopic=characters&name='.urlencode($result['name']).'">'.$result['name'].'</a></center></td><TD WIDTH=5%><img src=\'images/loteria/'.urlencode($result['item']).'.gif\'></td><TD WIDTH=30%><b>'.$result['item'].'</b></td><TD WIDTH=30%><center>BAIAK</center></td></tr>'; 
} 
$main_content .= '</table>'; 
?>

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...