Advertisement
Guest User

modules/ranking/woe.php

a guest
Sep 22nd, 2014
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. <?php
  2. if (!defined('FLUX_ROOT')) exit;
  3.  
  4. $title    = 'WoE Ranking';
  5. $classes  = Flux::config('JobClasses')->toArray();
  6. $jobClass = $params->get('jobclass');
  7. $bind     = array((int)Flux::config('RankingHideLevel'));
  8.  
  9. if (trim($jobClass) === '') {
  10.     $jobClass = null;
  11. }
  12.  
  13. if (!is_null($jobClass) && !array_key_exists($jobClass, $classes)) {
  14.     $this->deny();
  15. }
  16.  
  17. $sql = "SELECT
  18. `char`.name  AS char_name,
  19. char.class AS char_class,
  20. `char`.char_id,
  21. damage_done,damage_received,kill_count,death_count,score,emperium_kill,hp_heal_potions,sp_heal_potions,emperium_damage FROM `char_wstats` LEFT JOIN  `char` ON `char`.`char_id` = `char_wstats`.`char_id` WHERE `char_wstats`.`kill_count` > 0 ";
  22.  
  23. if (!is_null($jobClass)) {
  24.     $sql .= "AND char.class = ? ";
  25.     $bind[] = $jobClass;
  26. }
  27. $sql .= "ORDER BY `char_wstats`.`kill_count` DESC";
  28.  
  29.  
  30. $sth  = $server->connection->getStatement($sql);
  31.  
  32. $sth->execute($bind);
  33.  
  34. $chars = $sth->fetchAll();
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement