Postado Julho 11, 2016 9 anos Highscores: Spoiler <?PHP $list = $_REQUEST['list']; $page = $_REQUEST['page']; switch($list) { case "fist": $id = 0; $list_name = 'Fist'; break; case "club": $id = 1; $list_name = 'Club'; break; case "sword": $id = 2; $list_name = 'Sword'; break; case "axe": $id = 3; $list_name = 'Axe'; break; case "distance": $id = 4; $list_name = 'Distance'; break; case "shield": $id = 5; $list_name = 'Shielding'; break; case "fishing": $id = 6; $list_name = 'Fishing'; break; } if(!isset($id)) if($list == "magic") $list_name = "Maglevel"; else { $list_name = 'Level'; $list = 'experience'; } if(count($config['site']['worlds']) > 1) { $worlds .= '<i>Select world:</i> '; foreach($config['site']['worlds'] as $idd => $world_n) { if($idd == (int) $_GET['world']) { $world_id = $idd; $world_name = $world_n; } } } if($idd == (int) $_GET['world']) { $world_id = $idd; $world_name = $world_n; } if(!isset($world_id)) { $world_id = 0; $world_name = $config['server']['serverName']; } $offset = $page * 100; if(isset($id)) $skills = $SQL->query('SELECT name,online,value,level,vocation,promotion FROM players,player_skills WHERE players.world_id = '.$world_id.' AND players.deleted = 0 AND players.group_id < '.$config['site']['players_group_id_block'].' AND players.id = player_skills.player_id AND player_skills.skillid = '.$id.' ORDER BY value DESC, count DESC LIMIT 101 OFFSET '.$offset); elseif($list == "magic") $skills = $SQL->query('SELECT name,online,maglevel,level,vocation,promotion FROM players WHERE players.world_id = '.$world_id.' AND players.deleted = 0 AND players.group_id < '.$config['site']['players_group_id_block'].' AND name != "Account Manager" ORDER BY maglevel DESC, manaspent DESC LIMIT 101 OFFSET '.$offset); elseif($list == "experience") $skills = $SQL->query('SELECT name,online,level,experience,vocation,promotion FROM players WHERE players.world_id = '.$world_id.' AND players.deleted = 0 AND players.group_id < '.$config['site']['players_group_id_block'].' AND name != "Account Manager" ORDER BY level DESC, experience DESC LIMIT 101 OFFSET '.$offset); //wyswietlanie wszystkiego $main_content .= '<center> <table> <tr> <td valign="top"> <SCRIPT LANGUAGE="JavaScript"> function selecturl(s) { var gourl = s.options[s.selectedIndex].value; window.top.location.href = gourl; } </SCRIPT> <FORM> <SELECT class="textbox" name="urljump" OnChange="selecturl(this)"> <OPTION VALUE="">'.$list_name.'</OPTION> <option value="?subtopic=highscores&list=experience&world=0">Level</option> <option value="?subtopic=highscores&list=magic&world=0">Maglevel</option> <option value="?subtopic=highscores&list=fist&world=0">Fist</option> <option value="?subtopic=highscores&list=club&world=0">Club</option> <option value="?subtopic=highscores&list=sword&world=0">Sword</option> <option value="?subtopic=highscores&list=axe&world=0">Axe</option> <option value="?subtopic=highscores&list=distance&world=0">Distance</option> <option value="?subtopic=highscores&list=shield&world=0">Shielding</option> <option value="?subtopic=highscores&list=fishing&world=0">Fishing</option> </SELECT> </FORM> </table>'; $main_content .= '<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=2 WIDTH=50%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD WIDTH=10% CLASS=whites><B>#</B></TD><TD WIDTH=75% CLASS=whites><B>Name</B></TD><TD WIDTH=15% CLASS=whites><b><center>'.$list_name.'</center></B></TD>'; foreach($skills as $skill) { if($number_of_rows < 100) { if($list == "magic") $skill['value'] = $skill['maglevel']; if($list == "experience") $skill['value'] = $skill['level']; if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><td>'.($offset + $number_of_rows).'</td><td><a href="?subtopic=characters&name='.urlencode($skill['name']).'">'.($skill['online']>0 ? "<font color=\"green\">".$skill['name']."</font>" : "<font color=\"white\">".$skill['name']."</font>").'</a><br></small></td><td><center>'.$skill['value'].'</center></td>'; $main_content .= '</tr>'; } else $show_link_to_next_page = TRUE; } $main_content .= '</TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%>'; if($page > 0) $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.$list.'&page='.($page - 1).'" CLASS="size_xxs">Previous Page</A></TD></TR>'; if($show_link_to_next_page) $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.$list.'&page='.($page + 1).'" CLASS="size_xxs">Next Page</A></TD></TR>'; $main_content .= '</TABLE></TD><TD WIDTH=5%><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=1 HEIGHT=1 BORDER=0></TD><TD WIDTH=15% VALIGN=top ALIGN=right><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1><TR BGCOLOR="'.$config['site']['vdarkborder'].'"></TD></TR></TABLE>'; ?> Who is Online: Spoiler <?PHP $update_interval = 2; if(count($config['site']['worlds']) > 1) { $worlds .= '<i>Select world:</i> '; foreach($config['site']['worlds'] as $id => $world_n) { $worlds .= ' <a href="?subtopic=whoisonline&world='.$id.'">'.$world_n.'</a> , '; if($id == (int) $_GET['world']) { $world_id = $id; $world_name = $world_n; } } $main_content .= substr($worlds, 0, strlen($worlds)-3); } if(!isset($world_id)) { $world_id = 0; $world_name = $config['server']['serverName']; } $order = $_REQUEST['order']; if($order == 'level') $orderby = 'level'; elseif($order == 'vocation') $orderby = 'vocation'; if(empty($orderby)) $orderby = 'name'; $tmp_file_name = 'cache/whoisonline-'.$orderby.'-'.$world_id.'.tmp'; if(file_exists($tmp_file_name) && filemtime($tmp_file_name) > (time() - $update_interval)) { $tmp_file_content = explode(",", file_get_contents($tmp_file_name)); $number_of_players_online = $tmp_file_content[0]; $players_rows = $tmp_file_content[1]; } else { $players_online_data = $SQL->query('SELECT * FROM players WHERE world_id = '.(int) $world_id.' AND online > 0 ORDER BY '.$orderby); $number_of_players_online = 0; foreach($players_online_data as $player) { $number_of_players_online++; $i++; $acc = $SQL->query('SELECT flag, vip_time FROM '.$SQL->tableName('accounts').' WHERE '.$SQL->fieldName('id').' = '.$player['account_id'].' LIMIT 1;')->fetch(); if(is_int($number_of_players_online / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $rs = ""; $players_rows .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=10%><font color="white" size="2">'.$i.'</TD><TD WIDTH=40%><font color="orange" size="2"><a href="?subtopic=characters&name='.urlencode($player['name']).'">'.$player['name'].$rs.'</TD>'; $players_rows .= '<TD WIDTH=30%><font color="white" size="2">'.$vocation_name[$world_id][$player['promotion']][$player['vocation']].'</TD><TD WIDTH=10%><font color="white" size="2">'.$player['level'].'</TD></TR>'; } file_put_contents($tmp_file_name, $number_of_players_online.','.$players_rows); } //Wykresik 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 width="50"><B>Server Status</B></TD></TR><TR BGCOLOR="'.$config['site']['darkborder'].'"><td width="50"<TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD> Atualmente ninguem esta jogando em <b>'.$config['site']['worlds'][$world_id].'</b>.</TD></TR></TABLE></TD></TR></TABLE><BR>'; else { //Vocations pics $vocs = array(); foreach($SQL->query('SELECT `vocation`, COUNT(`id`) AS `count` FROM `players` WHERE `world_id` = "'.$world_id.'" AND `online` > 0 GROUP BY `vocation`') as $entry) $vocs[$entry['vocation']] = $entry['count']; //list of players $main_content .= '<TABLE BORDER=0 CELLSPACING=2 CELLPADDING=4 WIDTH=80%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD><A style="color: white;<TD><A HREF="?subtopic=whoisonline&order=name&world='.$world_id.'" CLASS=white>#</A></TD><TD><A style="color: white;<TD><A HREF="?subtopic=whoisonline&order=name&world='.$world_id.'" CLASS=white>Name</A></TD><TD><A style="color: white;</TR><TD><A HREF="?subtopic=whoisonline&order=vocation&world='.$world_id.'" CLASS=white>Vocation</TD><TD><A style="color: white;<TD><A HREF="?subtopic=whoisonline&order=level&world='.$world_id.'" CLASS=white>Level</A></TD>'.$players_rows.'</TABLE>'; //search bar $main_content .= ''; } ?> Bom gente eu queria que alguem adiciona-se pra min em Highscores.php e Who Is online.php, quem for premium account mostra o nome VIP ao lado do nome do player. Se o player nao for premium account nao mostra nds. Rep+
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.