minor bugfixes and created info for tournaments

main
hecht 7 years ago
parent 6846f50a2d
commit f65cc8da78

@ -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);

@ -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());

@ -542,7 +542,7 @@ function isClanLocked($clanid) {
$res = db_query($sql);
if(!$res)
echo $sql . '<br>';
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 . '<br>';
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 . '<br>';
db_query($sql);
}
foreach($add as $user_id) {
$sql = 'INSERT INTO `clan_challenge_whitelist`(`user_id`, `clan_id`) values('.$user_id.', '.$clan_id.')';

@ -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

@ -1,77 +0,0 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$nodisturb = 'YES';
include_once('path.inc.php'); // get the path ;)
include_once(ROOT_PATH.'/include/config.inc.php');
include_once(ROOT_PATH.'/include/char.inc.php');
include_once(ROOT_PATH.'/include/parse.inc.php');
// GET-Section
// Kritisch (SQL-Injections)
$spleoic = validateStringCritical($_GET['spleoic']);
$kampf_id = validateUnsignedInteger($_GET['kampf_id'], null);
$art = validateString($_GET['art']);
?>
<body bgcolor="#202020">
<?php
if(!$spleoic) { $spleoic = "top_kampf";
} else {
echo "<p align=center>$back<br>&nbsp;<br>";
$kampf2 = mysqli_fetch_array(db_query("SELECT id FROM `$spleoic` ORDER BY id ASC LIMIT 1"));
$kampf1 = mysqli_fetch_array(db_query("SELECT * FROM `$spleoic` WHERE id='$kampf_id' LIMIT 1"));
$turnier_uids = mysqli_fetch_array(db_query("SELECT id FROM `$spleoic` WHERE art='$art' ORDER BY id ASC"));
if((($kampf_id-$turnier_uids['id']+1) * 300) + $kampf1['dauer'] > time()) {
echo "Fehler Sie k&ouml;nnen diesen Kampf nicht anschauen bevor er vorbei ist";
exit;
}
}
$kampf1 = mysqli_fetch_array(db_query("SELECT * FROM turnier_kampf WHERE id='$kampf_id' LIMIT 1"));
$char1 = getChar($kampf1['char1']);
$char2 = getChar($kampf1['char2']);
$char_1 = $char1;
$char_2 = $char2;
$arena = mysqli_fetch_array(db_query("SELECT name, besitzer FROM arena WHERE id='$kampf1[arena_name]' LIMIT 1"));
$starke1 = explode(",", $kampf1['starke1']);
$starke2 = explode(",", $kampf1['starke2']);
$ver1 = explode(",", $kampf1['ver1']);
$ver2 = explode(",", $kampf1['ver2']);
$speed1 = explode(",", $kampf1['speed1']);
$speed2 = explode(",", $kampf1['speed2']);
$ausdauer1 = explode(",", $kampf1['ausdauer1']);
$ausdauer2 = explode(",", $kampf1['ausdauer2']);
$glueck1 = explode(',', $kampf1['glueck1']);
$glueck2 = explode(',', $kampf1['glueck2']);
$schaden1 = explode(",", $kampf1['schaden1']);
$schaden2 = explode(",", $kampf1['schaden2']);
$attacke1 = explode(",", $kampf1['attacke1']);
$attacke2 = explode(",", $kampf1['attacke2']);
$hp1 = explode(",", $kampf1['hp1']);
$hp2 = explode(",", $kampf1['hp2']);
$mp1 = explode(",", $kampf1['mp1']);
$mp2 = explode(",", $kampf1['mp2']);
$a_hp1 = explode(",", $char_1['hp']);
$a_hp2 = explode(",", $char_2['hp']);
$a_mp1 = explode(",", $char_1['mp']);
$a_mp2 = explode(",", $char_2['mp']);
$runde = 1;
include(ROOT_PATH.'/include/kampf_anzeige.php');
?>

@ -24,16 +24,27 @@ include_once(ROOT_PATH.'/include/tournament.inc.php');
<th valign="top" colspan="3" align="center">Turnier Auswahl</th>
</tr>
<?php
$day_translation = array('Sonntags', 'Montags', 'Dienstags', 'Mittwochs', 'Donnerstags', 'Freitags', 'Samstags', 'Sonntags');
$tournament_types = getTournamentTypes();
foreach ($tournament_types as $tournament_type) {
$info = 'Das Turnier ist';
if ( $tournament_type['day_of_week'] !== NULL ) {
$info .= ' einmal die Woche, '.$day_translation[$tournament_type['day_of_week']];
} else if ( $tournament_type['day_of_month'] !== NULL ) {
$info .= ' immer am '.$tournament_type['day_of_month'].'. jeden Monats';
} else {
continue;
}
$info .= ',<br>um '.$tournament_type['hour_of_day'].' Uhr ('.$tournament_type['competitors'].' Spieler).';
?>
<tr>
<td valign="top" align="center">
<a href='javascript:kampf("<?php echo $tournament_type['id']; ?>");'>
<img border="0" src="<?php echo $tournament_type['icon']; ?>" title="Das Turnier ist einmal die Woche, Sonntags um 15 Uhr. (64 Spieler)" width="150" height="150" />
<img border="0" src="<?php echo $tournament_type['icon']; ?>" title="<?php echo join(' ', explode('<br>', $info)); ?>" width="150" height="150" />
</a>
</td>
<td align="center">Hier kommt noch info hin (to be programmed)</td>
<td align="center"><?php echo $info; ?></td>
</tr>
<?php

Loading…
Cancel
Save