Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Boa tarde galera, uso gesior 2012 num tfs 1.3, uso sistema de premium como se fosse vip, gostaria que no whoisonline aparecesse o status se é premmy ou nao ao lado do nome.

Alguem pode me ajudar? 

Segue meu código do whoisonline:

<?PHP header("Content-Type: text/html; charset=UTF-8",true);
if(!defined('INITIALIZED'))
	exit;

$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('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') . ', ' . $SQL->tableName('players_online') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('players_online') . '.' . $SQL->fieldName('player_id') . ' 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%><A HREF="?subtopic=characters&name='.urlencode($player['name']).'">'.htmlspecialchars($player['name']).$skull.'<TD WIDTH=10%>'.$player['level'].'</TD><TD WIDTH=20%>'.htmlspecialchars($vocation_name[$player['vocation']]).'</TD></TR>';
}		
if($number_of_players_online == 0)
{
	//server status - server empty
	$main_content .= '
	<div class="TableContainer" >
<table class="Table1" cellpadding="0" cellspacing="0">
<div class="CaptionContainer" >
<div class="CaptionInnerContainer" >
<span class="CaptionEdgeLeftTop" style="background-image:url(http://i.imgur.com/q7aLDPp.gif);" /></span>
<span class="CaptionEdgeRightTop" style="background-image:url(http://i.imgur.com/q7aLDPp.gif);" /></span>
<span class="CaptionBorderTop" style="background-image:url(http://i.imgur.com/9StwSZL.gif);" ></span>
<span class="CaptionVerticalLeft" style="background-image:url(http://i.imgur.com/TgwWl21.gif);" /></span>
<div class="Text" >World Information</div>
<span class="CaptionVerticalRight" style="background-image:url(http://i.imgur.com/TgwWl21.gif);" /></span>
<span class="CaptionBorderBottom" style="background-image:url(http://i.imgur.com/9StwSZL.gif);" ></span>        
<span class="CaptionEdgeLeftBottom" style="background-image:url(http://i.imgur.com/q7aLDPp.gif);" /></span>
<span class="CaptionEdgeRightBottom" style="background-image:url(http://i.imgur.com/q7aLDPp.gif);" /></span>
</div></div>
<tr><td>        
<div class="InnerTableContainer" >
<table style="width:100%;" >
<tr><td class="LabelV200" >Status:</td>
<td>
<div style="position: absolute; top: 35px; right: 6px;" ></div>
Online</td></tr><tr><td class="LabelV200" >Players Online: </td><td>'.$number_of_players_online.' Players Online</td></tr>
<tr>
<tr><td class="LabelV200" >Creation Date:</td><td>17/05/2018</td></tr><tr>
<td class="LabelV200" >Location:</td><td>South&#160;America</td></tr>
<tr><td class="LabelV200" >PvP Type:</td><td>Open-PvP</td></tr></tr>
</table></div></td></tr></table></div><br/>

	<div class="TableContainer" >
		<table class="Table2" cellpadding="0" cellspacing="0">
			<div class="CaptionContainer" >
				<div class="CaptionInnerContainer" > 
					<span class="CaptionEdgeLeftTop" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
					<span class="CaptionEdgeRightTop" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
					<span class="CaptionBorderTop" style="background-image:url(./layouts/tibiacom/images/content/table-headline-border.gif);" ></span> 
					<span class="CaptionVerticalLeft" style="background-image:url(./layouts/tibiacom/images/content/box-frame-vertical.gif);" /></span>					
					<div class="Text" >Players Online</div>
					<span class="CaptionVerticalRight" style="background-image:url(./layouts/tibiacom/images/content/box-frame-vertical.gif);" /></span>
					<span class="CaptionBorderBottom" style="background-image:url(./layouts/tibiacom/images/content/table-headline-border.gif);" ></span> 
					<span class="CaptionEdgeLeftBottom" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
					<span class="CaptionEdgeRightBottom" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
				</div>
			</div>
			<tr>
				<td>
					<div class="InnerTableContainer" >
						<table style="width:100%;" >
							<tr>
								<td>No online players.</td>
							</tr>
						</table>
					</div>
				</td>
			</tr>
		</table>
	</div>
	<div>  
	
	</div>
	<form method="post" action="?subtopic=characters">
		<div class="TableContainer" >
			<table class="Table1" cellpadding="0" cellspacing="0">
				<div class="CaptionContainer" >
					<div class="CaptionInnerContainer" > 
						<span class="CaptionEdgeLeftTop" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
						<span class="CaptionEdgeRightTop" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
						<span class="CaptionBorderTop" style="background-image:url(./layouts/tibiacom/images/content/table-headline-border.gif);" ></span> 
						<span class="CaptionVerticalLeft" style="background-image:url(./layouts/tibiacom/images/content/box-frame-vertical.gif);" /></span>						
						<div class="Text" >Search Character</div>
						<span class="CaptionVerticalRight" style="background-image:url(./layouts/tibiacom/images/content/box-frame-vertical.gif);" /></span>
						<span class="CaptionBorderBottom" style="background-image:url(./layouts/tibiacom/images/content/table-headline-border.gif);" ></span> 
						<span class="CaptionEdgeLeftBottom" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
						<span class="CaptionEdgeRightBottom" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
					</div>
				</div>
				<tr>
					<td>
						<div class="InnerTableContainer" >
							<table style="width:100%;" >
								<tr>
									<td style="vertical-align:middle;" class="LabelV150" >Character Name:</td>
									<td style="width:170px;" ><input style="width:165px;" name="name" value="" size="29" maxlength="29" /></td>
									<td>
										<div class="BigButton" style="background-image:url(./layouts/tibiacom/images/buttons/sbutton.gif)" >
											<div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(./layouts/tibiacom/images/buttons/sbutton_over.gif);" ></div>
												<input class="ButtonText" type="image" name="Submit" alt="Submit" src="./layouts/tibiacom/images/buttons/_sbutton_submit.gif" >
											</div>
										</div>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</form>   
	';
}
else
{
	//list of players
	$main_content .= '
	<div class="TableContainer" >
<table class="Table1" cellpadding="0" cellspacing="0">
<div class="CaptionContainer" >
<div class="CaptionInnerContainer" >
<span class="CaptionEdgeLeftTop" style="background-image:url(http://i.imgur.com/q7aLDPp.gif);" /></span>
<span class="CaptionEdgeRightTop" style="background-image:url(http://i.imgur.com/q7aLDPp.gif);" /></span>
<span class="CaptionBorderTop" style="background-image:url(http://i.imgur.com/9StwSZL.gif);" ></span>
<span class="CaptionVerticalLeft" style="background-image:url(http://i.imgur.com/TgwWl21.gif);" /></span>
<div class="Text" >World Information</div>
<span class="CaptionVerticalRight" style="background-image:url(http://i.imgur.com/TgwWl21.gif);" /></span>
<span class="CaptionBorderBottom" style="background-image:url(http://i.imgur.com/9StwSZL.gif);" ></span>        
<span class="CaptionEdgeLeftBottom" style="background-image:url(http://i.imgur.com/q7aLDPp.gif);" /></span>
<span class="CaptionEdgeRightBottom" style="background-image:url(http://i.imgur.com/q7aLDPp.gif);" /></span>
</div></div>
<tr><td>        
<div class="InnerTableContainer" >
<table style="width:100%;" >
<tr><td class="LabelV200" >Status:</td>
<td>
<div style="position: absolute; top: 35px; right: 6px;" ></div>
Online</td></tr><tr><td class="LabelV200" >Players Online: </td><td>'.$number_of_players_online.' Players Online</td></tr>
<tr>
<tr><td class="LabelV200" >Creation Date:</td><td>17/05/2018</td></tr><tr>
<td class="LabelV200" >Location:</td><td>South&#160;America</td></tr>
<tr><td class="LabelV200" >PvP Type:</td><td>Open-PvP</td></tr></tr>
</table></div></td></tr></table></div><br/>

 <div class="TableContainer">
                <table class="Table2" cellpadding="0" cellspacing="0">
                <div class="CaptionContainer">
                <div class="CaptionInnerContainer">
                <span class="CaptionEdgeLeftTop" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif)"></span>
                <span class="CaptionEdgeRightTop" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif)"></span>
                <span class="CaptionBorderTop" style="background-image:url(./layouts/tibiacom/images/content/table-headline-border.gif)"></span>
                <span class="CaptionVerticalLeft" style="background-image:url(./layouts/tibiacom/images/content/box-frame-vertical.gif)"></span>
                <div class="Text">Players Online
<span class="CaptionVerticalRight" style="background-image:url(./layouts/tibiacom/images/content/box-frame-vertical.gif)"></span>
<span class="CaptionBorderBottom" style="background-image:url(./layouts/tibiacom/images/content/table-headline-border.gif)"></span>
<span class="CaptionEdgeLeftBottom" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif)"></span>
<span class="CaptionEdgeRightBottom" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif)"></span>
</div>
</div>
<tr>
<td>
<div class="InnerTableContainer">
<table width="100%">
<tr class="LabelH">
<td style="text-align:left;width:34%">Name<small style="font-weight:normal"></small>
<td style="text-align:left;width:34%"><A HREF="?subtopic=whoisonline&order=level" CLASS=black>Level</A>&#160;&#160;
<img class="sortarrow" src="./layouts/tibiacom/images/news/blank.gif"/></td>
<td style="text-align:left;width:34%">Vocation&#160;&#160;<small style="font-weight:normal"></small>
<img class="sortarrow" src="./layouts/tibiacom/images/news/blank.gif"/></td>
<div style="text-align:left;width:34%">'.$players_rows.'<small style="font-weight:normal"></div>
</table>
</table>
</div>
';
	
	//search bar
	$main_content .= '
	<div>   </div>
	<form method="post" action="?subtopic=characters">
		<div class="TableContainer" >
			<table class="Table1" cellpadding="0" cellspacing="0">
				<div class="CaptionContainer" >
					<div class="CaptionInnerContainer" > 
						<span class="CaptionEdgeLeftTop" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
						<span class="CaptionEdgeRightTop" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
						<span class="CaptionBorderTop" style="background-image:url(./layouts/tibiacom/images/content/table-headline-border.gif);" ></span> 
						<span class="CaptionVerticalLeft" style="background-image:url(./layouts/tibiacom/images/content/box-frame-vertical.gif);" /></span>						
						<div class="Text" >Search Character</div>
						<span class="CaptionVerticalRight" style="background-image:url(./layouts/tibiacom/images/content/box-frame-vertical.gif);" /></span>
						<span class="CaptionBorderBottom" style="background-image:url(./layouts/tibiacom/images/content/table-headline-border.gif);" ></span> 
						<span class="CaptionEdgeLeftBottom" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
						<span class="CaptionEdgeRightBottom" style="background-image:url(./layouts/tibiacom/images/content/box-frame-edge.gif);" /></span>
					</div>
				</div>
				<tr>
					<td>
						<div class="InnerTableContainer" >
							<table style="width:100%;" >
								<tr>
									<td style="vertical-align:middle;" class="LabelV150" >Character Name:</td>
									<td style="width:170px;" ><input style="width:165px;" name="name" value="" size="29" maxlength="29" /></td>
									<td>
										<div class="BigButton" style="background-image:url(./layouts/tibiacom/images/buttons/sbutton.gif)" >
											<div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(./layouts/tibiacom/images/buttons/sbutton_over.gif);" ></div>
												<input class="ButtonText" type="image" name="Submit" alt="Submit" src="./layouts/tibiacom/images/buttons/_sbutton_submit.gif" >
											</div>
										</div>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</form>
	';
}

 

 

Link para o post
Compartilhar em outros sites

Não sei muito bem se seria isto que você está procurando, mas se for deixa aquele joinha!

Spoiler

   <?PHP
$order = $_REQUEST['order'];
$vipPlayers = 0;
if($order == 'level')
    $orderby = 'level';
elseif($order == 'vocation')
    $orderby = 'vocation';
if(empty($orderby))
    $orderby = 'name';
$players_online_data = $SQL->query('SELECT `players`.`name`, `players`.`level`, `players`.`promotion`, `players`.`vocation`, `accounts`.`flag`, `accounts`.`premdays` FROM `accounts`,`players` WHERE `accounts`.`id`=`players`.`account_id` AND `players`.`online`=1 ORDER BY '.$orderby.'');
$number_of_players_online = 0;
foreach($players_online_data as $player) {
    $number_of_players_online++;
    if(is_int($number_of_players_online / 2))
        $bgcolor = $config['site']['darkborder'];
    else
        $bgcolor = $config['site']['lightborder'];
 
}
if($player['premdays'] > '0') {
    $vip = '<font color="green">[ Vip Account ]</font> - '.$player['premdays'].' days left';
}
else {
    $vip = '';
}
    $players_rows .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=5%><center><image src="flags/'.$player['flag'].'.gif"></center></TD><TD WIDTH=70%><A HREF="index.php?subtopic=characters&name='.$player['name'].'">'.$player['name'].'</A> '.$vip.'</TD><TD WIDTH=10%>'.$player['level'].'</TD><TD WIDTH=20%>'.$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 '.$config['server']['serverName'].'.</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.</TD></TR></TABLE></TD></TR></TABLE><BR>';
    //list of players
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD><center><A HREF="index.php?subtopic=whoisonline&order=name" CLASS=white>#</A></center></TD><TD><A HREF="index.php?subtopic=whoisonline&order=name" CLASS=white>Name</A></TD><TD><A HREF="index.php?subtopic=whoisonline&order=level" CLASS=white>Level</A></TD><TD><A HREF="index.php?subtopic=whoisonline&order=vocation" CLASS=white>Vocation</TD></TR>'.$players_rows.'</TABLE>';
    //search bar
    $main_content .= '<BR><FORM ACTION="index.php?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>';
}
?>

 

Editado por Andersen96 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

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

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

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Andersontatuador
      .Qual servidor ou website você utiliza como base? 
      Global Full 8.60 + Zao
      Qual o motivo deste tópico? 
      O site não esta adicionando os pontos na conta dos plays.
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       



    • Por A.Mokk
      .Qual servidor ou website você utiliza como base? 
      TFS 0.4
      Qual o motivo deste tópico? 
      Estou tendo um probleminha indelicado no meu site, gostaria de obter respostas aqui com voces que sao sempre muito eficientes e praticos.
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      Canary
      Qual o motivo deste tópico? 
      Não consigo deixar ele automatico os players tem que confirmar o pagamento depois eu tenho que verificar se caiu pra depois eu confirmar e colocar as coins
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por Jordan422
      Faala Deuses do Tibia! Estou com um projeto sólido de um global old, mas to preso nessa parte do website viu.. Eu dou meu jeitinho mas ta chegando nas coisas avançadas que precisa daquele freelancer bacana para ajeitar umas páginas para mim! Já tenho as ideias, basta somente botar a mão na massa.. Quem estiver interessado por favor entrar em contato por mensagem aqui no Tibiaking mesmo ou preferencialmente pelo discord mythh9257 
       
    • Por moleza
      Para quem quer abrir um servidor antigo que roda em php5 e está com dificuldade com a configuração do linux, pode contratar um cpanel que contenha o php5 que facilita a configuração do site!!
       
      essa foi a minha solução!
       
      Resolvido !!
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo