Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.91 KB | None | 0 0
  1. <?php
  2. if(count($config['site']['worlds']) > 1)
  3. {
  4. foreach($config['site']['worlds'] as $idd => $world_n)
  5. {
  6. if($idd == (int) $_REQUEST['world'])
  7. {
  8. $world_id = $idd;
  9. $world_name = $world_n;
  10. }
  11. }
  12. }
  13. if(!isset($world_id))
  14. {
  15. $world_id = 0;
  16. $world_name = $config['server']['serverName'];
  17. }
  18. if(count($config['site']['worlds']) > 1)
  19. {
  20. $main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD></TD><TD>
  21. <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'].'">
  22. <TABLE BORDER=0 CELLPADDING=1><TR><TD>Players online on world:</TD><TD><SELECT SIZE="1" NAME="world">';
  23. foreach($config['site']['worlds'] as $id => $world_n)
  24. {
  25. if($id == $world_id)
  26. $main_content .= '<OPTION VALUE="'.htmlspecialchars($id).'" selected="selected">'.htmlspecialchars($world_n).'</OPTION>';
  27. else
  28. $main_content .= '<OPTION VALUE="'.htmlspecialchars($id).'">'.htmlspecialchars($world_n).'</OPTION>';
  29. }
  30. $main_content .= '</SELECT> </TD><TD><INPUT TYPE="image" NAME="Submit" ALT="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif">
  31. </TD></TR></TABLE></TABLE></FORM></TABLE>';
  32. }
  33. $orderby = 'name';
  34. if(isset($_REQUEST['order']))
  35. {
  36. if($_REQUEST['order']== 'level')
  37. $orderby = 'level';
  38. elseif($_REQUEST['order'] == 'vocation')
  39. $orderby = 'vocation';
  40. }
  41. $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();
  42. $number_of_players_online = 0;
  43. $vocations_online_count = array(0,0,0,0,0); // change it if you got more then 5 vocations
  44. $players_rows = '';
  45. foreach($players_online_data as $player){
  46. $vocations_online_count[$player['vocation']] += 1;
  47. $bgcolor = (($number_of_players_online++ % 2 == 1) ? $config['site']['lightborder'] : $config['site']['darkborder']);
  48. if($player['vocation'] == "1")
  49. $player['vocation'] = "Fire";
  50. if($player['vocation'] == "2")
  51. $player['vocation'] = "Water";
  52. if($player['vocation'] == "3")
  53. $player['vocation'] = "Air";
  54. if($player['vocation'] == "4")
  55. $player['vocation'] = "Earth";
  56. $players_rows .= '<TR BGCOLOR='.$bgcolor.'><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%><center>'.$player['level'].'</center></TD><TD WIDTH=20%><center>'.$player['vocation'].'</center></TD></TR>';
  57. }
  58. if($config['site']['private-servlist.com_server_id'] > 0)
  59. {
  60. $main_content.= '<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD WIDTH=10% CLASS=white><center><B>Players Online Chart</B></TD></TR></TABLE><table align="center"><tr><td><img src="http://private-servlist.com/server-chart/' . $config['site']['private-servlist.com_server_id'] . '.png" width="500px" /></td></tr></table>';
  61. }
  62. if($number_of_players_online == 0)
  63. {
  64. //server status - server empty
  65. $main_content .= '<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Who is Online?</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Atualmente nenhum jogador está online.</TD></TR></TABLE></TD></TR></TABLE><BR>';
  66. }
  67. else
  68. {
  69. //list of players
  70. $main_content .= '<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><b>Name</b></A></TD><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><b><center>Level</b></center></A></TD><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><b><center>Element</b></center></TD></TR>'.$players_rows.'</TABLE>';
  71. //search bar
  72. $main_content .= '<BR><FORM ACTION="?subtopic=characters" METHOD=post> <TABLE WIDTH=100% BORDER=1 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>';
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement