From b60a825bd86c485659eaae38e31080975b3d80b2 Mon Sep 17 00:00:00 2001 From: hecht Date: Fri, 15 Aug 2014 19:00:04 +0000 Subject: [PATCH] NPCs wurden in Top50 User gezeigt --- ag/ranglist.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ag/ranglist.php b/ag/ranglist.php index 8b25f50..99e7792 100644 --- a/ag/ranglist.php +++ b/ag/ranglist.php @@ -10,6 +10,7 @@ include_once(ROOT_PATH.'/include/config.inc.php'); include_once(ROOT_PATH.'/include/parse.inc.php'); include_once(ROOT_PATH.'/include/fehlerausgabe.inc.php'); include_once(ROOT_PATH.'/include/designfunctions.inc.php'); +include_once(ROOT_PATH.'/include/rassen.inc.php'); include_once(ROOT_PATH.'/include/char.inc.php'); // GET-Section @@ -41,8 +42,14 @@ function displayHighscore($wahl, $char_name, $user, $char_vorhanden){ if($wahl == 'geld') { $choice_s = mysql_query('SELECT geld, id FROM user where id >= 2 ORDER BY geld DESC LIMIT 50'); } else { + $npc_race = getRaceTypeName('NPC'); // do not remove npc (there is a separate setting for this) + $races = getRacesByType($npc_race); // remove all NPC + foreach($races as $race) { + $exclude_race_ids[] = '\''.$race['id'].'\''; + } + $sql = 'SELECT c.name, c.level, c.besitzer, c.starke, c.preis, c.speed, c.glueck, c.bild, c.verteidigung, c.ausdauer, c.siege, c.niederlagen, c.id as charid, starke+verteidigung+speed+ausdauer+glueck as powerlevel FROM chars c ' . - 'WHERE rasse != \'NPC\' ORDER BY ('.$wahl.') DESC LIMIT 50'; + 'WHERE rasse NOT IN('.implode(',',$exclude_race_ids).') ORDER BY ('.$wahl.') DESC LIMIT 50'; // Uncomment for hp/mp in PL // $sql = 'SELECT cl.clanzeichen, u.nickname, u.id as userid, c.name, c.level, c.besitzer, c.starke, c.preis, c.speed, c.glueck, c.bild, c.verteidigung, c.ausdauer, c.siege, c.niederlagen, c.id as charid, starke+verteidigung+speed+ausdauer+glueck+substring_index(hp,\',\',-1)/10+substring_index(mp,\',\',-1)/5 as powerlevel' .