Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. $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();
  2. $number_of_players_online = 0;
  3. $vocations_online_count = array(0,0,0,0,0); // change it if you got more then 5 vocations
  4. $players_rows = '';
  5. foreach($players_online_data as $player)
  6. {
  7. $vocations_online_count[$player['vocation']] += 1;
  8. $bgcolor = (($number_of_players_online++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']);
  9. //start guild
  10. $player_id = $SQL->query('SELECT rank_id from players where name = "'.htmlspecialchars($player['name']).'"')->fetch();
  11. $player_id = $player_id['rank_id'];
  12. $has_guild = $SQL->query('SELECT guild_id from guild_ranks where id = '. $player_id .'')->fetch();
  13. $has_guild = $has_guild['guild_id'];
  14. if($has_guild == 0){
  15. $guild_d_player = "No Guild";
  16. }else{
  17. $guild_do_player = $SQL->query('SELECT name from guilds where id = '.$has_guild.' > 0')->fetch();
  18. $guild_do_player = $guild_do_player ['name'];
  19. $guild_d_player = "";
  20. }
  21.  
  22. //end guild
  23. $players_rows .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=5%><img src="' . $config['site']['outfit_images_url'] . '?id=' . $player['looktype'] . '&addons=' . $player['lookaddons'] . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] . '" alt="" /></td><TD WIDTH=30%><A HREF="characters&name='.urlencode($player['name']).'">'.htmlspecialchars($player['name']).'</A></TD><TD WIDTH=25%><center><A HREF="guilds&action=show&guild='.$has_guild.'">'.$guild_do_player .'</A>'.$guild_d_player.'</center></TD><TD WIDTH=8%><center>'.$player['level'].'</center></TD><TD WIDTH=20%><center>'.htmlspecialchars($vocation_name[$player['promotion']][$player['vocation']]).'</center></TD></TR>';
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement