fixed tournaments and clan fights

main
hecht 7 years ago
parent 2f9b2ed4a3
commit 5962016c16

@ -59,7 +59,7 @@ function displayChallengeClan($user, $clan_id) {
return; return;
} }
//TODO: es sollte hier unbedingt ne Auswahl geben wieviel Leute nun kämpfen dürfen :) //TODO: es sollte hier unbedingt ne Auswahl geben wieviel Leute nun kämpfen dürfen :)
$result = challengeClan($user, $clan_id, 5); $result = challengeClan($user, $clan_id, MIN_MEMBERS);
if ($result != NULL) { if ($result != NULL) {
displayErrorMessage(NULL, $result, displayHistoryBackLink()); displayErrorMessage(NULL, $result, displayHistoryBackLink());
return; return;

@ -29,7 +29,7 @@ function persistTournamentChanges($request) {
if ($key == 'id') { if ($key == 'id') {
continue; continue;
} else if ($key == 'name') { } else if ($key == 'name' || $key == 'abbrevation' || $key == 'icon' || $key == 'fruit_type') {
$changes[] = $key.'=\''.$value.'\''; $changes[] = $key.'=\''.$value.'\'';
} else { } else {
$changes[] = $key.'='.$value; $changes[] = $key.'='.$value;
@ -38,7 +38,7 @@ function persistTournamentChanges($request) {
$sql = 'UPDATE tournament_types SET '.join(', ', $changes).' WHERE id = '.$request['id']; $sql = 'UPDATE tournament_types SET '.join(', ', $changes).' WHERE id = '.$request['id'];
// echo $sql; // echo $sql;
silent_query($sql); db_query($sql);
return db_affected_rows(); return db_affected_rows();
} }

@ -46,7 +46,7 @@ $GLOBALS['clan_challenge_buffered_instances'] = array ();
* @param int $clanid the id of the clan to challenge * @param int $clanid the id of the clan to challenge
* @param int $validTime the amount of hours that the challenge is valid * @param int $validTime the amount of hours that the challenge is valid
*/ */
function challengeClan(array $user, $clanid, $anzahl = 5, $type = DAVY_BACK_FIGHT, $validTime = 24) { function challengeClan(array $user, $clanid, $anzahl = MIN_MEMBERS, $type = DAVY_BACK_FIGHT, $validTime = 24) {
$clan = getClan($user['clan']); $clan = getClan($user['clan']);
$oclan = getClan($clanid); $oclan = getClan($clanid);

Loading…
Cancel
Save