Postado Junho 18, 2018 6 anos 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 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 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>   <img class="sortarrow" src="./layouts/tibiacom/images/news/blank.gif"/></td> <td style="text-align:left;width:34%">Vocation  <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> '; }
Postado Junho 18, 2018 6 anos 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 Junho 18, 2018 6 anos por Andersen96 (veja o histórico de edições)
Postado Junho 18, 2018 6 anos Autor ja testei esse ai, funciona nao, tu pegou de outro topico ne ? eu vi esse ai
Postado Junho 18, 2018 6 anos É dei uma procuradinha aqui, pra tentar ajuda! Mas aqui pelo menos funcionou! Editado Junho 18, 2018 6 anos por Andersen96 (veja o histórico de edições)
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.