Advertisement
Guest User

Untitled

a guest
May 27th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. <?PHP
  2. $order = $_REQUEST['order'];
  3. $vipPlayers = 0;
  4. if($order == 'level')
  5. $orderby = 'level';
  6. elseif($order == 'vocation')
  7. $orderby = 'vocation';
  8. if(empty($orderby))
  9. $orderby = 'name';
  10. $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.'');
  11. $number_of_players_online = 0;
  12. foreach($players_online_data as $player) {
  13. $number_of_players_online++;
  14. if(is_int($number_of_players_online / 2))
  15. $bgcolor = $config['site']['darkborder'];
  16. else
  17. $bgcolor = $config['site']['lightborder'];
  18.  
  19. }
  20. if($player['premdays'] > '0') {
  21. $vip = '<font color="green">[ Vip Account ]</font> - '.$player['premdays'].' days left';
  22. }
  23. else {
  24. $vip = '';
  25. }
  26. $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>';
  27.  
  28. if($number_of_players_online == 0)
  29. //server status - server empty
  30. $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>';
  31. else
  32. {
  33. //server status - someone is online
  34. $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>';
  35. //list of players
  36. $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>';
  37. //search bar
  38. $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>';
  39. }
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement