diff --git a/ag/char_profil.php b/ag/char_profil.php index e363d23..989a9fc 100644 --- a/ag/char_profil.php +++ b/ag/char_profil.php @@ -21,6 +21,20 @@ defineIfNotDefined('KAMPF_RUNDEN', 10); $char_id = validateUnsignedInteger($_GET['char_id'], null); +function getExcludeIds($userId, $excludeCharId) { + $ids = array(); + $qry = db_query('SELECT kampf_item from chars WHERE besitzer = '.$userId.' AND id != '.$excludeCharId); + while ($row = mysqli_fetch_row($qry)) { + foreach (explode(',', $row[0]) as $id) { + if(is_numeric($id) && $id > 0) { + $ids[] = $id; + } + } + } + return $ids; +} + + function stelledar($char_id,$user_ida,$name) { //Alle Chardaten laden //TODO: chardaten gefällt mir absolut nicht! Das muss man anders regeln =/ @@ -57,6 +71,7 @@ function stelledar($char_id,$user_ida,$name) { $e_schild = db_query("SELECT i.name, w.id, i.level FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE (i.type='$char_1[type]' OR i.type='ALL') AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Schild' AND i.level <='$char_1[level]' group by i.name order by i.level desc"); $e_helm = db_query("SELECT i.name, w.id, i.level FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE (i.type='$char_1[type]' OR i.type='ALL') AND w.user='$user_ida[id]' AND w.ru_mal='1' AND i.s_type='Helm' AND i.level <='$char_1[level]' group by i.name order by i.level desc"); $checked = explode(',',$char_1['kampf_item']); + $excludeIds = getExcludeIds($user_ida['id'], $char_id); ?>