Ir para conteúdo
Banner com Efeitos

É possível colocar uma coluna para aparecer a Residencia (townid) do lado do level??

Featured Replies

Postado
Citar
  1. <?php
  2. if(!defined('INITIALIZED'))
  3.     exit;
  4.  
  5. if(count($config['site']['worlds']) > 1)
  6. {
  7.     foreach($config['site']['worlds'] as $idd => $world_n)
  8.     {
  9.         if($idd == (int) $_REQUEST['world'])
  10.         {
  11.             $world_id = $idd;
  12.             $world_name = $world_n;
  13.         }
  14.     }
  15. }
  16. if(!isset($world_id))
  17. {
  18.     $world_id = 0;
  19.     $world_name = $config['server']['serverName'];
  20. }
  21. if(count($config['site']['worlds']) > 1)
  22. {
  23.     $main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD></TD><TD>
  24.     <FORM ACTION="" METHOD=get><INPUT TYPE="hidden" NAME="subtopic" VALUE="whoisonline"><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>World Selection</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'">
  25.     <TABLE BORDER=0 CELLPADDING=1><TR><TD>Players online on world:</TD><TD><SELECT SIZE="1" NAME="world">';
  26.     foreach($config['site']['worlds'] as $id => $world_n)
  27.     {
  28.         if($id == $world_id)
  29.             $main_content .= '<OPTION VALUE="'.htmlspecialchars($id).'" selected="selected">'.htmlspecialchars($world_n).'</OPTION>';
  30.         else
  31.             $main_content .= '<OPTION VALUE="'.htmlspecialchars($id).'">'.htmlspecialchars($world_n).'</OPTION>';
  32.     }
  33.     $main_content .= '</SELECT> </TD><TD><INPUT TYPE="image" NAME="Submit" ALT="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif">
  34.         </TD></TR></TABLE></TABLE></FORM></TABLE>';
  35. }
  36. $orderby = 'name';
  37. if(isset($_REQUEST['order']))
  38. {
  39.     if($_REQUEST['order']== 'level')
  40.         $orderby = 'level';
  41.     elseif($_REQUEST['order'] == 'vocation')
  42.         $orderby = 'vocation';
  43. }
  44. $players_online_data = $SQL->query('SELECT ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('flag') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('vocation') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('promotion') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('level') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('skull') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looktype') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookaddons') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookhead') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookbody') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looklegs') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookfeet') . ' FROM ' . $SQL->tableName('accounts') . ', ' . $SQL->tableName('players') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('world_id') . ' = ' . $SQL->quote($world_id) . ' AND ' . $SQL->tableName('players') . '.' . $SQL->fieldName('online') . ' = ' . $SQL->quote(1) . ' AND ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('players') . '.' . $SQL->fieldName('account_id') . ' ORDER BY ' . $SQL->fieldName($orderby))->fetchAll();
  45. $number_of_players_online = 0;
  46. $vocations_online_count = array(0,0,0,0,0); // change it if you got more then 5 vocations
  47. $players_rows = '';
  48. foreach($players_online_data as $player)
  49. {
  50.     $vocations_online_count[$player['vocation']] += 1;
  51.     $bgcolor = (($number_of_players_online++ % 2 == 1) ?  $config['site']['darkborder'] : $config['site']['lightborder']);
  52.     $skull = '';
  53.     if ($player['skull'] == 4)
  54.         $skull = "<img style='border: 0;' src='./images/skulls/redskull.gif'/>";
  55.     else if ($player['skull'] == 5)
  56.         $skull = "<img style='border: 0;' src='./images/skulls/blackskull.gif'/>";
  57.  
  58.     $players_rows .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=5%><img src="' . $config['site']['outfit_images_url'] . '?id=' . $player['looktype'] . '&addons=' . $player['lookaddons'] . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] . '" alt="" /></td><TD WIDTH=65%><A HREF="?subtopic=characters&name='.urlencode($player['name']).'">'.htmlspecialchars($player['name']).$skull.'<img src="' . $config['site']['flag_images_url'] . $player['flag'] . $config['site']['flag_images_extension'] . '" title="Country: ' . $player['flag'] . '" alt="' . $player['flag'] . '" /></A></TD><TD WIDTH=10%>'.$player['level'].'</TD><TD WIDTH=20%>'.htmlspecialchars($vocation_name[$player['promotion']][$player['vocation']]).'</TD></TR>';
  59. }      
  60.  
  61. if($number_of_players_online == 0)
  62. {
  63.     //server status - server empty
  64.     $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently no one is playing on <b>'.htmlspecialchars($config['site']['worlds'][$world_id]).'</b>.</TD></TR></TABLE></TD></TR></TABLE><BR>';
  65. }
  66. else
  67. {
  68.     //server status - someone is online
  69.     $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently '.$number_of_players_online.' players are online - <b>'.$config['status']['serverStatus_players'] .' ' . (($config['status']['serverStatus_players']  > 1) ? 'are' : 'is') . ' active</b> and <b>'.($number_of_players_online-$config['status']['serverStatus_players']).' ' . (($number_of_players_online-$config['status']['serverStatus_players']  > 1) ? 'are' : 'is') . ' AFK</b> on <b>'.htmlspecialchars($config['site']['worlds'][$world_id]).'</b>.</TD></TR></TABLE></TD></TR></TABLE><BR>';
  70.  
  71.  
  72.     $main_content .= '<table width="200" cellspacing="1" cellpadding="0" border="0" align="center">
  73.         <tbody>
  74.             <tr>
  75.                 <tr bgcolor="'.$config['site']['darkborder'].'">
  76.                 <td><img src="images/vocations/sorcerer.png" /></td>
  77.                 <td><img src="images/vocations/druid.png" /></td>
  78.                 <td><img src="images/vocations/paladin.png" /></td>
  79.                 <td><img src="images/vocations/knight.png" /></td>
  80.             </tr>
  81.             <tr>
  82.                 <tr bgcolor="'.$config['site']['vdarkborder'].'">
  83.                 <td style="text-align: center;"><strong style="color:white">Sorcerers</strong></td>
  84.                 <td style="text-align: center;"><strong style="color:white">Druids</strong></td>
  85.                 <td style="text-align: center;"><strong style="color:white">Paladins</strong></td>
  86.                 <td style="text-align: center;"><strong style="color:white">Knights</strong></td>
  87.             </tr>
  88.             <tr>
  89.                 <TR BGCOLOR="'.$config['site']['lightborder'].'">
  90.                 <td style="text-align: center;">'.$vocations_online_count[1].'</td>
  91.                 <td style="text-align: center;">'.$vocations_online_count[2].'</td>
  92.                 <td style="text-align: center;">'.$vocations_online_count[3].'</td>
  93.                 <td style="text-align: center;">'.$vocations_online_count[4].'</td>
  94.             </tr>
  95.         </tbody>
  96.     </table>
  97.     <div style="text-align: center;">&nbsp;</div>';
  98.  
  99.     //list of players
  100.     $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS="white"><b>Outfit</b></TD><TD><A HREF="?subtopic=whoisonline&order=name&world='.$world_id.'" CLASS=white>Name</A></TD><TD><A HREF="?subtopic=whoisonline&order=level&world='.urlencode($world_id).'" CLASS=white>Level</A></TD><TD><A HREF="?subtopic=whoisonline&order=vocation&world='.urlencode($world_id).'" CLASS=white>Vocation</TD></TR>'.$players_rows.'</TABLE>';
  101.     //search bar
  102.     $main_content .= '<BR><FORM ACTION="?subtopic=characters" METHOD=post>  <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE="" SIZE="29" MAXLENGTH="29"></TD><TD><INPUT TYPE="image" NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
  103. }

 

Editado por dervin13 (veja o histórico de edições)

Postado
<?php
if(!defined('INITIALIZED'))
    exit;
 
if(count($config['site']['worlds']) > 1)
{
    foreach($config['site']['worlds'] as $idd => $world_n)
    {
        if($idd == (int) $_REQUEST['world'])
        {
            $world_id = $idd;
            $world_name = $world_n;
        }
    }
}
if(!isset($world_id))
{
    $world_id = 0;
    $world_name = $config['server']['serverName'];
}
if(count($config['site']['worlds']) > 1)
{
    $main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD></TD><TD>
    <FORM ACTION="" METHOD=get><INPUT TYPE="hidden" NAME="subtopic" VALUE="whoisonline"><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>World Selection</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'">
    <TABLE BORDER=0 CELLPADDING=1><TR><TD>Players online on world:</TD><TD><SELECT SIZE="1" NAME="world">';
    foreach($config['site']['worlds'] as $id => $world_n)
    {
        if($id == $world_id)
            $main_content .= '<OPTION VALUE="'.htmlspecialchars($id).'" selected="selected">'.htmlspecialchars($world_n).'</OPTION>';
        else
            $main_content .= '<OPTION VALUE="'.htmlspecialchars($id).'">'.htmlspecialchars($world_n).'</OPTION>';
    }
    $main_content .= '</SELECT> </TD><TD><INPUT TYPE="image" NAME="Submit" ALT="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif">
        </TD></TR></TABLE></TABLE></FORM></TABLE>';
}
$orderby = 'name';
if(isset($_REQUEST['order']))
{
    if($_REQUEST['order']== 'level')
        $orderby = 'level';
    elseif($_REQUEST['order'] == 'vocation')
        $orderby = 'vocation';
}
$players_online_data = $SQL->query('SELECT ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('flag') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('vocation') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('promotion') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('level') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('skull') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looktype') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookaddons') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookhead') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookbody') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looklegs') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookfeet') . ' FROM ' . $SQL->tableName('accounts') . ', ' . $SQL->tableName('players') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('world_id') . ' = ' . $SQL->quote($world_id) . ' AND ' . $SQL->tableName('players') . '.' . $SQL->fieldName('online') . ' = ' . $SQL->quote(1) . ' AND ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('players') . '.' . $SQL->fieldName('account_id') . ' ORDER BY ' . $SQL->fieldName($orderby))->fetchAll();
$number_of_players_online = 0;
$vocations_online_count = array(0,0,0,0,0); // change it if you got more then 5 vocations
$players_rows = '';
foreach($players_online_data as $player)
{
    $vocations_online_count[$player['vocation']] += 1;
    $bgcolor = (($number_of_players_online++ % 2 == 1) ?  $config['site']['darkborder'] : $config['site']['lightborder']);
    $skull = '';
    if ($player['skull'] == 4)
        $skull = "<img style='border: 0;' src='./images/skulls/redskull.gif'/>";
    else if ($player['skull'] == 5)
        $skull = "<img style='border: 0;' src='./images/skulls/blackskull.gif'/>";
 
    $players_rows .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=5%><img src="' . $config['site']['outfit_images_url'] . '?id=' . $player['looktype'] . '&addons=' . $player['lookaddons'] . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] . '" alt="" /></td><TD WIDTH=65%><A HREF="?subtopic=characters&name='.urlencode($player['name']).'">'.htmlspecialchars($player['name']).$skull.'<img src="' . $config['site']['flag_images_url'] . $player['flag'] . $config['site']['flag_images_extension'] . '" title="Country: ' . $player['flag'] . '" alt="' . $player['flag'] . '" /></A></TD><TD WIDTH=10%>'.$player['level'].'</TD><TD WIDTH=10%>'.$towns_list[$player->getWorld()][$player->getTownId()].'</TD><TD WIDTH=20%>'.htmlspecialchars($vocation_name[$player['promotion']][$player['vocation']]).'</TD></TR>';
}      
 
if($number_of_players_online == 0)
{
    //server status - server empty
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently no one is playing on <b>'.htmlspecialchars($config['site']['worlds'][$world_id]).'</b>.</TD></TR></TABLE></TD></TR></TABLE><BR>';
}
else
{
    //server status - someone is online
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently '.$number_of_players_online.' players are online - <b>'.$config['status']['serverStatus_players'] .' ' . (($config['status']['serverStatus_players']  > 1) ? 'are' : 'is') . ' active</b> and <b>'.($number_of_players_online-$config['status']['serverStatus_players']).' ' . (($number_of_players_online-$config['status']['serverStatus_players']  > 1) ? 'are' : 'is') . ' AFK</b> on <b>'.htmlspecialchars($config['site']['worlds'][$world_id]).'</b>.</TD></TR></TABLE></TD></TR></TABLE><BR>';
 
 
    $main_content .= '<table width="200" cellspacing="1" cellpadding="0" border="0" align="center">
        <tbody>
            <tr>
                <tr bgcolor="'.$config['site']['darkborder'].'">
                <td><img src="images/vocations/sorcerer.png" /></td>
                <td><img src="images/vocations/druid.png" /></td>
                <td><img src="images/vocations/paladin.png" /></td>
                <td><img src="images/vocations/knight.png" /></td>
            </tr>
            <tr>
                <tr bgcolor="'.$config['site']['vdarkborder'].'">
                <td style="text-align: center;"><strong style="color:white">Sorcerers</strong></td>
                <td style="text-align: center;"><strong style="color:white">Druids</strong></td>
                <td style="text-align: center;"><strong style="color:white">Paladins</strong></td>
                <td style="text-align: center;"><strong style="color:white">Knights</strong></td>
            </tr>
            <tr>
                <TR BGCOLOR="'.$config['site']['lightborder'].'">
                <td style="text-align: center;">'.$vocations_online_count[1].'</td>
                <td style="text-align: center;">'.$vocations_online_count[2].'</td>
                <td style="text-align: center;">'.$vocations_online_count[3].'</td>
                <td style="text-align: center;">'.$vocations_online_count[4].'</td>
            </tr>
        </tbody>
    </table>
    <div style="text-align: center;">&nbsp;</div>';
 
    //list of players
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS="white"><b>Outfit</b></TD><TD><A HREF="?subtopic=whoisonline&order=name&world='.$world_id.'" CLASS=white>Name</A></TD><TD><A HREF="?subtopic=whoisonline&order=level&world='.urlencode($world_id).'" CLASS=white>Level</A></TD><TD><A HREF="?subtopic=whoisonline&order=vocation&world='.urlencode($world_id).'" CLASS=white>Vocation</TD></TR>'.$players_rows.'</TABLE>';
    //search bar
    $main_content .= '<BR><FORM ACTION="?subtopic=characters" METHOD=post>  <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE="" SIZE="29" MAXLENGTH="29"></TD><TD><INPUT TYPE="image" NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
}

 

Postado
  • Autor

Não funcionou, no error aparece isso aqui 

Query: SELECT `accounts`.`flag`, `players`.`name`, `players`.`vocation`, `players`.`promotion`, `players`.`level`, `players`.`skull`, `players`.`looktype`, `players`.`lookaddons`, `players`.`lookhead`, `players`.`lookbody`, `players`.`looklegs`, `players`.`lookfeet` FROM `accounts`, `players` WHERE `players`.`world_id` = '0' AND `players`.`online` = '1' AND `accounts`.`id` = `players`.`account_id` ORDER BY `name`
SQLSTATE: 00000
Driver code:  
Error message:
Postado

isso ai não é um error, é uma mensagem de banco dizendo que o select que ele fez retornou tudo com sucesso.

3 horas atrás, dervin13 disse:

Não funcionou, no error aparece isso aqui 

Query: SELECT `accounts`.`flag`, `players`.`name`, `players`.`vocation`, `players`.`promotion`, `players`.`level`, `players`.`skull`, `players`.`looktype`, `players`.`lookaddons`, `players`.`lookhead`, `players`.`lookbody`, `players`.`looklegs`, `players`.`lookfeet` FROM `accounts`, `players` WHERE `players`.`world_id` = '0' AND `players`.`online` = '1' AND `accounts`.`id` = `players`.`account_id` ORDER BY `name`
SQLSTATE: 00000
Driver code:  
Error message:

 

<?php

$assinatura = function($texto) {
	return $texto;
};

$assinatura('Eu ainda não tenho uma assinatura decente ):, php ♥');
?>

Meus sites.:

https://ferobraglobal.com/
https://codenome.com/
https://uam.codenome.com/

https://myci.myara.net/

 

Me ajuda no café:
http://picpay.me/ricardo.codenome

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo