diff --git a/ag/gm/include/attacken.inc.php b/ag/gm/include/attacken.inc.php
index 1cdd1ae..bf49b67 100644
--- a/ag/gm/include/attacken.inc.php
+++ b/ag/gm/include/attacken.inc.php
@@ -430,9 +430,9 @@ function editAttack($attackname, $attackid, $Frucht, $starke, $verteidigung, $sp
if($Frucht != 0){
- $sql = 'UPDATE attacken set name = \''.htmlspecialchars(urldecode($attackname)).'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = '.$Frucht.', runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.$options.'\' where id = '.$attackid;
+ $sql = 'UPDATE attacken set name = \''.$attackname.'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = '.$Frucht.', runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.$options.'\' where id = '.$attackid;
} else {
- $sql = 'UPDATE attacken set name = \''.htmlspecialchars(urldecode($attackname)).'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = NULL, runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.$options.'\' where id = '.$attackid;
+ $sql = 'UPDATE attacken set name = \''.$attackname.'\', starke = '.$starke.', verteidigung = '.$verteidigung.', speed = '.$speed.', hp = '.$hp.', mp = '.$mp.', rassen = \''.$rassen.'\', level = '.$level.', geld = '.$geld.', type = \''.$type.'\', info = \''.$info.'\', req_atk = \''.$req_atk.'\', req_lvl = \''.$req_lvl.'\', Frucht = NULL, runden = '.$runden.', maxlvl = '.$maxlvl.', options = \''.$options.'\' where id = '.$attackid;
}
if($row['name'] != $attackname){
db_query('Update lernen set name = \''.$attackname.'\' WHERE at_id ='.$attackid);
diff --git a/ag/include/clan.inc.php b/ag/include/clan.inc.php
index 0b174a0..9c37df5 100644
--- a/ag/include/clan.inc.php
+++ b/ag/include/clan.inc.php
@@ -203,7 +203,7 @@ function fireMember($user, $member){
// delete the participation in open clan fights! Thats tricky because the user itself is not stored in the database!!
db_query('DELETE FROM clan_challenge_whitelist WHERE clan_id = ' .$clan['id'] . ' AND user_id = ' .$user['id']);
- db_query('DELETE FROM clan_challenge_participants WHERE clan_challenge_id in (SELECT clan_challenge_id FROM clan_challenge where calculated = FALSE) and char_id IN (Select id FROM chars where besitzer = '.$user['id'].')');
+ db_query('DELETE FROM clan_challenge_participants WHERE clan_challenge_id in (SELECT clan_challenge_id FROM clan_challenges where calculated = FALSE) and char_id IN (Select id FROM chars where besitzer = '.$user['id'].')');
}
} else{
echo displayErrorMessage(NULL, 'Du kannst den Member nicht feuern!', displayHistoryBackLink());
diff --git a/ag/include/clan_fights.inc.php b/ag/include/clan_fights.inc.php
index a361ce6..dd661a3 100644
--- a/ag/include/clan_fights.inc.php
+++ b/ag/include/clan_fights.inc.php
@@ -542,7 +542,7 @@ function isClanLocked($clanid) {
$res = db_query($sql);
if(!$res)
echo $sql . '
';
- db_query('UPDATE clan_challenge_requests SET active = FALSE WHERE (clan_challenged = '.$clanid.' OR clan_requester = '.$clanid);
+ db_query('UPDATE clan_challenge_requests SET active = FALSE WHERE (clan_challenged = '.$clanid.' OR clan_requester = '.$clanid.')');
db_query('DELETE FROM clan_challenges WHERE calculated = FALSE AND clan_challenge_id IN (SELECT clan_challenge_id from clan_challenge_clans WHERE clan_id = '.$clanid.')');
} else if($lock['members'] < MIN_MEMBERS){ // we have to update the actual row
// UPDATE
@@ -966,9 +966,11 @@ function updateAuthorizedClanfightCoordinators($clan_id, array $user_ids) {
$add = array_diff($user_ids, $ids);
$remove = array_diff($ids, $user_ids);
- $sql = 'DELETE FROM `clan_challenge_whitelist` WHERE `user_id` IN (' . implode(',', $remove) .') AND `clan_id` = ' . $clan_id;
- // echo $sql . '
';
- db_query($sql);
+ if (count($remove) > 0) {
+ $sql = 'DELETE FROM `clan_challenge_whitelist` WHERE `user_id` IN (' . implode(',', $remove) .') AND `clan_id` = ' . $clan_id;
+ // echo $sql . '
';
+ db_query($sql);
+ }
foreach($add as $user_id) {
$sql = 'INSERT INTO `clan_challenge_whitelist`(`user_id`, `clan_id`) values('.$user_id.', '.$clan_id.')';
diff --git a/ag/item.php b/ag/item.php
index 7adf5b1..0185f23 100644
--- a/ag/item.php
+++ b/ag/item.php
@@ -50,6 +50,9 @@ function getTradeItems($userid){
$index = 0;
$arenalvl = mysqli_fetch_array(db_query("SELECT level FROM arena WHERE besitzer = ".$userid.";"));
+ if (!$arenalvl) {
+ $arenalvl['level'] = 0;
+ }
// Die etwas abgewandelten SQL-Querys aus dem auktion_functions.php
$query = 'SELECT i.id, i.name, count(i.id) AS anzahl, tausch_anzahl, tausch_lvl, \'ware\' as tablename FROM ware w INNER JOIN item i ON(i.id=w.item_id) WHERE w.user = '.$userid.' AND s_type = \'Trank\' AND tausch_lvl <= '.$arenalvl['level'].' GROUP BY i.id
union
diff --git a/ag/last_fight2.php b/ag/last_fight2.php
deleted file mode 100644
index 41c48e3..0000000
--- a/ag/last_fight2.php
+++ /dev/null
@@ -1,77 +0,0 @@
-
-