cleanup plus some changes about presentation

main
hecht 13 years ago
parent 0567c7890e
commit 26696dedce

@ -1,366 +0,0 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
?>
<SCRIPT language="JavaScript">
function clankampf(clan_fight_id){
window.open("./last_fight3.php?kampf_id="+clan_fight_id+"&spleoic=clan_fights","","status=no,hotkeys=no,Height=600,Width=929,scrollbars=yes");
}
</SCRIPT>
<?php
include_once(ROOT_PATH.'//include/clanfights.inc.php');
include_once(ROOT_PATH.'//include/char.inc.php');
if (!empty($_POST['id'])) {
$id= $_POST['id'];
} elseif (!empty($_GET['id'])) {
$id= $_GET['id'];
}
switch ($id) {
case "1":
displaySelectNumberOfFighter($_POST['clanfighttyp']);
break;
case "2":
displayClanUser($user_ida[id],$_POST['numberoffighter'],$_POST['clanfighttyp'],'create');
break;
case "3":
displayCharsOfClanUser($user_ida[id], $_POST['user'], $_POST['numberoffighter'],$_POST['clanfighttyp'],'create');
break;
case "4":
displaySelectClanToFight($user_ida[id],$_POST['numberoffighter'],$_POST['clanfighttyp']);
break;
case "5":
$char_unserialized= unserialize(stripslashes($_POST['chars']));
if (isset($_POST['clan']) AND isset($char_unserialized) AND isset($_POST['zeitpunkt']) AND isset($_POST['datum']) /*AND isset($_POST['ausruestung']) */AND !empty($_POST['clan']) AND !empty($char_unserialized) AND (!empty($_POST['zeitpunkt']) OR $_POST['zeitpunkt'] == 0) AND !empty($_POST['datum'])/* AND !empty($_POST['ausruestung'])*/) {
if ($_POST['clan'] == 0) {
echo '<div style="text-align:center;"><input type="button" value="Zur&uuml;ck" onClick="history.back()"></div>';
echo '<p>Bitte w&auml;hle einen Clan aus</p>';
} else {
if (date("d.m.Y") == date("d.m.Y", $_POST['datum']) AND date("G") >= $_POST['zeitpunkt']) {
echo '<div style="text-align:center;"><input type="button" value="Zur&uuml;ck" onClick="history.back()"></div>';
echo '<p>Dieser Zeitpunkt ist bereits verstrichen. Bitte w&auml;hle einen Zeitpunkt der noch nicht verstrichen ist.</p>';
} else {
$clanid = getClanOfUser($user_ida[id]);
$timestamp= strtotime(date("d.m.Y", $_POST['datum']))+$_POST['zeitpunkt']*3600;
if (termineBereitsBelegt($clanid,$_POST['clan'],$timestamp) == 1) {
echo '<div style="text-align:center;"><input type="button" value="Zur&uuml;ck" onClick="history.back()"></div>';
echo '<p>'.$errmsg.'</p>';
echo '<p>Bitte w&auml;hle einen anderen Zeitpunkt!</p>';
} else {
erstelleClanKampf($user_ida[id],$_POST['clan'],$timestamp,unserialize(stripslashes($_POST['chars'])),$_POST['numberoffighter'],$_POST['clanfighttyp']);
$clandaten= getClanInformation($_POST['clan']);
echo '<p>Anfrage, zwecks einen Clankampfes, an Clan "<span style="font-weight:bold;">'.$clandaten['clanname'].'</span>" erfolgreich gesendet!</p>';
echo '<a href="index.php?as=clan/c_kampf">zur&uuml;ck zur &Uuml;bersicht</a>';
}
}
}
} else {
echo '<p>Bitte f&uuml;hre das Skript zur Herausforderung an einen anderen Clan korrekt aus und versuche nicht es irgendwie zu umgehen!</p>';
}
break;
case "del":
if (checkClanfight($_GET['kid']) == 1) {
if (clanfightFromOwnClan($_GET['kid'],$user_ida[id]) == 1) {
deleteClanFight($_GET['kid']);
} else {
echo $errmsg;
}
} else {
echo $errmsg;
}
break;
case "acc":
if (checkClanfight($_GET['kid']) == 1) {
if (clanfightToOwnClan($_GET['kid'],$user_ida[id]) == 1) {
displayClanUser($user_ida[id],getNumberOfFightersByClanfightID($_GET['kid']),'','accept');
} else {
echo $errmsg;
}
} else {
echo $errmsg;
}
break;
case "acc2":
displayCharsOfClanUser($user_ida[id], $_POST['user'], $_POST['numberoffighter'],'','accept');
break;
case "acc_fin":
acceptClanfight($_POST['kid'],$_POST['char']);
break;
case "dec":
if (checkClanfight($_GET['kid']) == 1) {
if (clanfightToOwnClan($_GET['kid'],$user_ida[id]) == 1) {
if (isset($_GET['true'])) {
declineClanfight($_GET['kid'],$_GET['true']);
} else {
declineClanfight($_GET['kid']);
}
} else {
echo $errmsg;
}
} else {
echo $errmsg;
}
break;
case "look":
if (checkClanfight($_GET['kid'],$_GET['id']) == 1) {
?>
<a href="index.php?as=clan/c_kampf&id=fights">zur&uuml;ck zur &Uuml;bersicht</a>
<table cellpadding="0" cellspacing="0" width="600" height="83">
<tr width="100%">
<th valign="middle" height="21" align="center">Clankampf</th>
</tr>
<?php
$anzahl_runden= mysql_fetch_assoc(mysql_query('SELECT runde FROM clan_fights WHERE clanfight_id='.$_GET['kid'].' ORDER BY id DESC LIMIT 1'));
$kampf_daten= mysql_fetch_assoc(mysql_query('SELECT clan, gclan, zeitpunkt, score_set FROM clan_fight_list WHERE id='.$_GET['kid'].' LIMIT 1'));
$pkt_satz_a= 0;
$pkt_satz_b= 0;
$pkt_runde_a= 0;
$pkt_runde_b= 0;
$x= 0;
$duration_of_one_fight= 60; // Anzahl der Sekunden wie lange es Fight dauern soll bis das Ergebnis angezeigt wird.
for ($y=1;$y<$anzahl_runden['runde']+1;$y++) {
$anzahl_kaempfe_bisherige_runden+= mysql_num_rows(mysql_query('SELECT * FROM clan_fights WHERE clanfight_id='.$_GET['kid'].' AND runde='.($y-1)));
$anzahl_kaempfe_inklusive_runden+= mysql_num_rows(mysql_query('SELECT * FROM clan_fights WHERE clanfight_id='.$_GET['kid'].' AND runde='.$y));
$anzahl_kaempfe_runde= mysql_num_rows(mysql_query('SELECT * FROM clan_fights WHERE clanfight_id='.$_GET['kid'].' AND runde='.$y));
if ($kampf_daten['zeitpunkt']+$anzahl_kaempfe_bisherige_runden*$duration_of_one_fight <= time()) {
echo '<tr><td colspan="2" height="15" valign="bottom" bgcolor="#cccccc" align="center">';
echo '<h3>Runde: '.$y.' ';
echo '</h3></td></tr>';
}
$o=0;
$kaempfe_query= mysql_query('SELECT * FROM clan_fights WHERE clanfight_id='.$_GET['kid'].' AND runde='.$y.' ORDER BY id ASC');
while ($kaempfe_array= mysql_fetch_assoc($kaempfe_query)) {
if($o == 0) {
$mul = '#018B8B';
$o++;
} else {
$mul = '#029393';
$o--;
}
$char_a= getChar2($kaempfe_array['char1']);
$char_b= getChar2($kaempfe_array['char2']);
if ($kaempfe_array['win'] == $kaempfe_array['char1']) {
$pkt_satz_a++;
} else {
$pkt_satz_b++;
}
if ($kampf_daten['zeitpunkt']+$x*$duration_of_one_fight <= time()) {
echo '<tr><td height="15" valign="middle" bgcolor="'.$mul.'" align="center">';
if (time()-$duration_of_one_fight < $kampf_daten['zeitpunkt']+$x*$duration_of_one_fight) {
echo $char_a['name'].' vs. '.$char_b['name'].'</td><td bgcolor="'.$mul.'">- : -';
} else {
if ($kaempfe_array['char1'] == $kaempfe_array['win']) {
echo '<a href="javascript:clankampf('.$kaempfe_array['id'].');"><b>'.$char_a['name'].'</b> vs. '.$char_b['name'].'</a></td><td bgcolor="'.$mul.'">'.$pkt_satz_a.' : '.$pkt_satz_b;
} else {
echo '<a href="javascript:clankampf('.$kaempfe_array['id'].');">'.$char_a['name'].' vs. <b>'.$char_b['name'].'</b></a></td><td bgcolor="'.$mul.'">'.$pkt_satz_a.' : '.$pkt_satz_b;
}
}
echo '</td></tr>';
}
$x++;
}
if ($pkt_satz_a > $pkt_satz_b) {
$pkt_runde_a++;
} elseif ($pkt_satz_b > $pkt_satz_a) {
$pkt_runde_b++;
}
$pkt_array[$y][pkt_satz_a]= $pkt_satz_a;
$pkt_array[$y][pkt_satz_b]= $pkt_satz_b;
$pkt_array[$y][pkt_runde_a]= $pkt_runde_a;
$pkt_array[$y][pkt_runde_b]= $pkt_runde_b;
$pkt_satz_a= 0;
$pkt_satz_b= 0;
}
?>
</table>
<p/>
<?php
if ($kampf_daten['zeitpunkt']+$anzahl_kaempfe_inklusive_runden*$duration_of_one_fight <= time()) {
$clan_a= getClanInformation($kampf_daten['clan']);
$clan_b= getClanInformation($kampf_daten['gclan']);
?>
<table align="center" style="background-color:#ccc;">
<tr>
<td style="font-weight:bold;">Runde:</td>
<?php
for ($y=1;$y<$anzahl_runden['runde']+1;$y++) {
echo '<td style="text-align:center;width:20px;font-weight:bold;">'.$y.'</td>';
}
?>
</tr>
<tr>
<td style="font-weight:bold;">Punkte <?php echo $clan_a[clanname]; ?>:</td>
<?php
for ($y=1;$y<$anzahl_runden['runde']+1;$y++) {
if ($pkt_array[$y][pkt_satz_a] > $pkt_array[$y][pkt_satz_b]) {
echo '<td style="text-align:center;width:20px;font-weight:bold;color:#f00;">'.$pkt_array[$y][pkt_satz_a].'</td>';
} else {
echo '<td style="text-align:center;width:20px;">'.$pkt_array[$y][pkt_satz_a].'</td>';
}
}
?>
</tr>
<tr>
<td style="font-weight:bold;">Punkte <?php echo $clan_b[clanname]; ?>:</td>
<?php
for ($y=1;$y<$anzahl_runden['runde']+1;$y++) {
if ($pkt_array[$y][pkt_satz_b] > $pkt_array[$y][pkt_satz_a]) {
echo '<td style="text-align:center;width:20px;font-weight:bold;color:#f00;">'.$pkt_array[$y][pkt_satz_b].'</td>';
} else {
echo '<td style="text-align:center;width:20px;">'.$pkt_array[$y][pkt_satz_b].'</td>';
}
}
?>
</tr>
</table>
<?php
echo '<p style="text-align:center;">'.$clan_a[clanname].' '.$pkt_array[count($pkt_array)][pkt_runde_a].' : '.$pkt_array[count($pkt_array)][pkt_runde_b].' '.$clan_b[clanname].'</p>';
if ($pkt_array[count($pkt_array)][pkt_runde_a] > $pkt_array[count($pkt_array)][pkt_runde_b]) {
echo '<p style="text-align:center;"><span style="font-weight:bold;">Gewinner</span>: '.$clan_a[clanname].' - <span style="font-weight:bold;">Verlierer</span>: '.$clan_b[clanname].'</p>';
} elseif ($pkt_array[count($pkt_array)][pkt_runde_b] > $pkt_array[count($pkt_array)][pkt_runde_a]) {
echo '<p style="text-align:center;"><span style="font-weight:bold;">Gewinner</span>: '.$clan_b[clanname].' - <span style="font-weight:bold;">Verlierer</span>: '.$clan_a[clanname].'</p>';
} else {
echo '<p style="text-align:center;">Der Clankampf zwischen '.$clan_b[clanname].' und '.$clan_a[clanname].' endet Unentschieden.</p>';
}
if ($kampf_daten['score_set'] == 0) {
if ($pkt_array[count($pkt_array)][pkt_runde_a] > $pkt_array[count($pkt_array)][pkt_runde_b]) {
$clan_a_updaten= mysql_query('UPDATE clan SET siege=siege+1 WHERE id='.$kampf_daten['clan'].' LIMIT 1');
$clan_b_updaten= mysql_query('UPDATE clan SET niederlagen=niederlagen+1 WHERE id='.$kampf_daten['gclan'].' LIMIT 1');
} elseif ($pkt_array[count($pkt_array)][pkt_runde_b] > $pkt_array[count($pkt_array)][pkt_runde_a]) {
$clan_a_updaten= mysql_query('UPDATE clan SET niederlagen=niederlagen+1 WHERE id='.$kampf_daten['clan'].' LIMIT 1');
$clan_b_updaten= mysql_query('UPDATE clan SET siege=siege+1 WHERE id='.$kampf_daten['gclan'].' LIMIT 1');
} else {
$clan_a_updaten= mysql_query('UPDATE clan SET unentschieden=unentschieden+1 WHERE id='.$kampf_daten['clan'].' LIMIT 1');
$clan_b_updaten= mysql_query('UPDATE clan SET unentschieden=unentschieden+1 WHERE id='.$kampf_daten['gclan'].' LIMIT 1');
}
$score_set_updaten= mysql_query('UPDATE clan_fight_list SET score_set=1 WHERE id='.$_GET['kid'].' LIMIT 1');
}
}
} else {
echo $errmsg;
}
break;
case "create":
displayClanFightType($user_ida[id]);
break;
case "fights":
$clanid= getClanOfUser($user_ida[id]);
echo getActualClanFightInformation($clanid,$user_ida[id]);
break;
case "look_survival":
if (checkClanfight($_GET['kid'],$_GET['id']) == 1) {
?>
<a href="index.php?as=clan/c_kampf&id=fights">zur&uuml;ck zur &Uuml;bersicht</a>
<table cellpadding="0" cellspacing="0" width="600" height="83">
<tr width="100%">
<th valign="middle" height="21" align="center">Clankampf</th>
</tr>
<?php
$anzahl_kaempfe= mysql_num_rows(mysql_query('SELECT id FROM clan_fights WHERE clanfight_id='.$_GET['kid']));
$kampf_daten= mysql_fetch_assoc(mysql_query('SELECT clan, gclan, zeitpunkt, score_set FROM clan_fight_list WHERE id='.$_GET['kid'].' LIMIT 1'));
$pkt_satz_a= 0;
$pkt_satz_b= 0;
$pkt_runde_a= 0;
$pkt_runde_b= 0;
$x= 0;
$duration_of_one_fight= 180; // Anzahl der Sekunden wie lange es Fight dauern soll bis das Ergebnis angezeigt wird.
$o=0;
$kaempfe_query= mysql_query('SELECT * FROM clan_fights WHERE clanfight_id='.$_GET['kid'].' ORDER BY id ASC');
while ($kaempfe_array= mysql_fetch_assoc($kaempfe_query)) {
if($o == 0) {
$mul = '#018B8B';
$o++;
} else {
$mul = '#029393';
$o--;
}
$char_a= getChar2($kaempfe_array['char1']);
$char_b= getChar2($kaempfe_array['char2']);
if ($kaempfe_array['win'] == $kaempfe_array['char1']) {
$pkt_satz_a++;
} else {
$pkt_satz_b++;
}
if ($kampf_daten['zeitpunkt']+$x*$duration_of_one_fight <= time()) {
echo '<tr><td height="15" valign="middle" bgcolor="'.$mul.'" align="center">';
if (time()-$duration_of_one_fight < $kampf_daten['zeitpunkt']+$x*$duration_of_one_fight) {
echo $char_a['name'].' vs. '.$char_b['name'].'</td><td bgcolor="'.$mul.'">- : -';
} else {
if ($kaempfe_array['char1'] == $kaempfe_array['win']) {
echo '<a href="javascript:clankampf('.$kaempfe_array['id'].');"><b>'.$char_a['name'].'</b> vs. '.$char_b['name'].'</a></td><td bgcolor="'.$mul.'">'.$pkt_satz_a.' : '.$pkt_satz_b;
} else {
echo '<a href="javascript:clankampf('.$kaempfe_array['id'].');">'.$char_a['name'].' vs. <b>'.$char_b['name'].'</b></a></td><td bgcolor="'.$mul.'">'.$pkt_satz_a.' : '.$pkt_satz_b;
}
}
echo '</td></tr>';
}
$x++;
}
?>
</table>
<p/>
<?php
if ($kampf_daten['zeitpunkt']+$anzahl_kaempfe*$duration_of_one_fight <= time()) {
$clan_a= getClanInformation($kampf_daten['clan']);
$clan_b= getClanInformation($kampf_daten['gclan']);
echo '<p style="text-align:center;">'.$clan_a[clanname].' <span style="font-weight:bold;">'.$pkt_satz_a.' : '.$pkt_satz_b.'</span> '.$clan_b[clanname].'</p>';
if ($pkt_satz_a > $pkt_satz_b) {
echo '<p style="text-align:center;"><span style="font-weight:bold;">Gewinner</span>: '.$clan_a[clanname].' - <span style="font-weight:bold;">Verlierer</span>: '.$clan_b[clanname].'</p>';
} elseif ($pkt_satz_b > $pkt_satz_a) {
echo '<p style="text-align:center;"><span style="font-weight:bold;">Gewinner</span>: '.$clan_b[clanname].' - <span style="font-weight:bold;">Verlierer</span>: '.$clan_a[clanname].'</p>';
}
if ($kampf_daten['score_set'] == 0) {
if ($pkt_satz_a > $pkt_satz_b) {
$clan_a_updaten= mysql_query('UPDATE clan SET siege=siege+1 WHERE id='.$kampf_daten['clan'].' LIMIT 1');
$clan_b_updaten= mysql_query('UPDATE clan SET niederlagen=niederlagen+1 WHERE id='.$kampf_daten['gclan'].' LIMIT 1');
} elseif ($pkt_satz_b > $pkt_satz_a) {
$clan_a_updaten= mysql_query('UPDATE clan SET niederlagen=niederlagen+1 WHERE id='.$kampf_daten['clan'].' LIMIT 1');
$clan_b_updaten= mysql_query('UPDATE clan SET siege=siege+1 WHERE id='.$kampf_daten['gclan'].' LIMIT 1');
}
$score_set_updaten= mysql_query('UPDATE clan_fight_list SET score_set=1 WHERE id='.$_GET['kid'].' LIMIT 1');
}
}
} else {
echo $errmsg;
}
break;
default:
checkIfChallengeTimedOut($user_ida[id]);
#checkIfClanFightsToExecute($user_ida[id]);
displayClanFights($user_ida[id]);
break;
}
?>

@ -1,46 +0,0 @@
<body>
<div align="center">
<center>
<table border="0" width="951" height="396">
<tr>
<td width="949" height="39" colspan="2">
<p align="center"><b>$CLANNAME Info</b></td>
</tr>
<tr>
<td width="96" height="28"><b>&nbsp;Leader:</b></td>
<td width="852" height="28">&nbsp;$LEADER</td>
</tr>
<tr>
<td width="96" height="28"><b>&nbsp;Co Leader.</b></td>
<td width="852" height="28">&nbsp;$COLEADER</td>
</tr>
<tr>
<td width="96" height="36"><b>&nbsp;Clanzeichen:</b></td>
<td width="852" height="36">&nbsp;$CLANZEICHEN</td>
</tr>
<tr>
<td width="96" height="28"><b>&nbsp;Member:</b></td>
<td width="852" height="27">&nbsp;$MIN_MEMBER / $MAX_MEMBER</td>
</tr>
<tr>
<td width="96" height="25"><b>&nbsp;Level:</b></td>
<td width="852" height="24">&nbsp;$LEVEL</td>
</tr>
<tr>
<td width="96" height="33"><b>&nbsp;Homepage:</b></td>
<td width="852" height="32">&nbsp;$HOMEPAGE</td>
</tr>
<tr>
<td width="96" height="23"><b>&nbsp;Info:</b></td>
<td width="852" height="172" rowspan="2">&nbsp;<textarea rows="10" cols="40" readonly>$CLAN_INFO</textarea></td>
</tr>
<tr>
<td width="96" height="144">&nbsp;</td>
</tr>
</table>
</center>
</div>
</body>

@ -1,20 +0,0 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
function gettemplate($template)
{
if(file_exists(''.$template.'.htm'))
{
$file = file(''.$template.'.htm');
$template = implode("",$file);
$template = str_replace("\"","\\\"",$template);
}
else $template='Das Template '.$template.' existiert nicht';
return $template;
}
?>

@ -1,56 +0,0 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################SSJ SPIELER 1
if ($technick1['type'] == 'SSJ') {
$k_mp[0] = $k_mp[0] - $technick1['mp'];
if ($k_mp[0] < 0) {
$schaden_2 = 'Keinen Schaden';
$schaden_1 = 'SSJ-Verwandlung fehlgeschlagen';
$aktion_AV1[$x] = 'nein';
$k_mp[0] = 0;
} else {
if (!$ssj_tech_1) {
$k_starke[0] = $k_starke[0] * $technick1['starke'];
$k_speed[0] = $k_speed[0] * $technick1['speed'];
$k_ver[0] = $k_ver[0] * $technick1['verteidigung'];
$schaden_2 = 'Keinen Schaden';
$schaden_1 = $technick1['name'];
$aktion_AV1[$x] = 'nein';
$ssj_tech_1 = $technick1['level'];
}
}
}
####################SSJ SPIELER 2
if ($technick2['type'] == 'SSJ') {
$k_mp[1] = $k_mp[1] - $technick2['mp'];
if ($k_mp[1] < 0) {
$schaden_1 = 'Keinen Schaden';
$schaden_2 = 'SSJ-Verwandlung fehlgeschlagen';
$aktion_AV2[$x] = 'nein';
$k_mp[1] = 0;
} else {
if (!$ssj_tech_2) {
$k_starke[1] = $k_starke[1] * $technick2['starke'];
$k_speed[1] = $k_speed[1] * $technick2['speed'];
$k_ver[1] = $k_ver[1] * $technick2['verteidigung'];
$schaden_1 = 'Keinen Schaden';
$schaden_2 = $technick2['name'];
$aktion_AV2[$x] = 'nein';
$ssj_tech_2 = $technick2['level'];
}
}
}
?>

@ -1,29 +0,0 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
#####################################KAMPF SYSTEM
$speed_prz_1 = $speed_char1/100;
$speed_prz_2 = $speed_char2/100;
if($speed_char1 > $speed_char2) {
if($speed_prz_1*90 >= $speed_char2) { $play1_ausweich=20; }
if($speed_prz_1*80 >= $speed_char2) { $play1_ausweich=41; }
if($speed_prz_1*70 >= $speed_char2) { $play1_ausweich=52; }
if($speed_prz_1*60 >= $speed_char2) { $play1_ausweich=63; }
if($speed_prz_1*50 >= $speed_char2) { $play1_ausweich=80; }
} else {
if($speed_prz_2*90 >= $speed_char1) { $play2_ausweich=20; }
if($speed_prz_2*80 >= $speed_char1) { $play2_ausweich=41; }
if($speed_prz_2*70 >= $speed_char1) { $play2_ausweich=52; }
if($speed_prz_2*60 >= $speed_char1) { $play2_ausweich=63; }
if($speed_prz_2*50 >= $speed_char1) { $play2_ausweich=80; }
}
$zufall_pl1=mt_rand(1,100);
$zufall_pl2=mt_rand(1,100);
?>

@ -1,25 +0,0 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
if ($x > 0) {
################### PLAYER 1
$k_starke[0] = round($k_starke[0] + (($k_ausdauer[0] / 20)) - ($k_starke[0] / 50));
$k_speed[0] = round($k_speed[0] + ($k_ausdauer[0] / 10));
$k_ver[0] = round($k_ver[0] + ($k_ausdauer[0] / 10));
$k_ausdauer[0] = round($k_ausdauer[0] - ($k_ausdauer[0] / 20));
################### PLAYER 2
$k_starke[1] = round($k_starke[1] + (($k_ausdauer[1] / 20)) - ($k_starke[1] / 50));
$k_speed[1] = round($k_speed[1] + ($k_ausdauer[1] / 10));
$k_ver[1] = round($k_ver[1] + ($k_ausdauer[1] / 10));
$k_ausdauer[1] = round($k_ausdauer[1] - ($k_ausdauer[1] / 20));
}
?>

@ -1,20 +0,0 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAMPF HP SPIELER 1
if($technick1['type'] == normal AND $technick1['hp'] > 0) {
$k_hp[0] = $k_hp[0] - $technick1[hp];
}
####################KAMPF HP SPIELER 2
if($technick2['type'] == normal AND $technick2['hp'] > 0) {
$k_hp[1] = $k_hp[1] - $technick2['hp'];
}
?>

@ -1,47 +0,0 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAMPF HP SPIELER 1
if ($speeds_char1 >= $speeds_char2) {
if ($technick1['type'] == 'hp') {
$k_mp[0] = $k_mp[0] - $technick1['mp'];
if ($k_mp[0] < 0) {
$k_mp[0] = 0;
} else {
$k_hp[0] = $k_hp[0] + $technick1['hp'];
if ($k_hp1[1] < $k_hp[0]) {
$k_hp[0] = $k_hp1[1];
}
$schaden_2 = 'Keinen Schaden';
$schaden_1 = '+ ' . $technick1['hp'] . ' HP';
}
$aktion_AV1[$x] = 'nein';
}
} else {
####################KAMPF HP SPIELER 2
if ($technick2['type'] == 'hp') {
$k_mp[1] = $k_mp[1] - $technick2['mp'];
if ($k_mp[1] < 0) {
$k_mp[1] = 0;
} else {
$k_hp[1] = $k_hp[1] + $technick2['hp'];
if ($k_hp2[1] < $k_hp[1]) {
$k_hp[1] = $k_hp2[1];
}
$schaden_1 = 'Keinen Schaden';
$schaden_2 = '+ '.$technick2['hp'].' HP';
}
$aktion_AV2[$x] = 'nein';
}
}
?>

@ -1,48 +0,0 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
//KAIOKEN SPIELER 1
if($technick1['type'] == 'kaioken'){
$k_mp[0] = $k_mp[0] - $technick1['mp'];
$k_hp[0] = $k_hp[0] - $technick1['hp'];
if($k_mp[0] < 0) {
$schaden_2 = 'Keinen Schaden';
$schaden_1 = 'kaioken fehlgeschlagen';
$aktion_AV1[$x] = 'nein';
$k_mp[0] = 0;
} else {
$schaden_2 = 'Keinen Schaden';
$schaden_1 = 'Kaioken';
$k_starke[0] = $k_starke[0] + $technick1['starke'];
$k_speed[0] = $k_speed[0] + $technick1['speed'];
$k_ver[0] = $k_ver[0] + $technick1['verteidigung'];
$aktion_AV1[$x] = 'nein';
}
}
//KAIOKEN SPIELER 2
if($technick2['type'] == 'kaioken') {
$k_mp[1] = $k_mp[1] - $technick2['mp'];
$k_hp[1] = $k_hp[1] - $technick2['hp'];
if($k_mp[1] < 0) {
$schaden_1 = 'Keinen Schaden';
$schaden_2 = 'kaioken fehlgeschlagen';
$aktion_AV2[$x] = 'nein';
$k_mp[1] = 0;
} else {
$k_starke[1] = $k_starke[1] + $technick2['starke'];
$k_speed[1] = $k_speed[1] + $technick2['speed'];
$k_ver[1] = $k_ver[1] + $technick2['verteidigung'];
$aktion_AV2[$x] = 'nein';
$schaden_1 = 'Keinen Schaden';
$schaden_2 = 'kaioken';
}
}
?>

@ -1,115 +0,0 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
if ($zufall_pl1 > $play2_ausweich) {
if (!$aktion_AV1[$x]) {
$alt_hp = $k_hp[1];
$charsa1_def = $k_ver[1] + $technick2['verteidigung'];
$charsa1_4_def = ($k_ver[1] + $technick2['verteidigung']) / 1.1;
if ($charsa1_def <= 2) {
$charsa1_def = 2;
}
if ($charsa1_4_def < 1) {
$charsa1_4_def = 1;
}
$charsa1_def = mt_rand($charsa1_4_def, $charsa1_def);
$charsa1_str = $k_starke[0] * 1.8 + $technick1['starke'];
$charsa1_4_str = ($k_starke[0] * 1.8 + $technick1['starke']) + 1;
if ($charsa1_str <= 2) {
$charsa1_str = 2;
}
if ($charsa1_4_str < 1) {
$charsa1_4_str = 1;
}
$charsa1_str = mt_rand($charsa1_4_str, $charsa1_str);
$k_hp[1] = round(($k_hp[1] + $charsa1_def - $charsa1_str +mt_rand(1, 20)));
$schaden_1 = $alt_hp - $k_hp[1];
if ($alt_hp < $k_hp[1]) {
$k_hp[1] = $alt_hp;
$schaden_1 = 0;
}
}
} else {
$schaden_1 = 'Keinen Schaden';
}
if ($zufall_pl2 > $play1_ausweich) {
if (!$aktion_AV2[$x]) {
$alt_hp = $k_hp[0];
$charsa2_def = $k_ver[0] + $technick1['verteidigung'];
$charsa2_4_def = ($k_ver[0] + $technick1['verteidigung']) / 1.1;
if ($charsa2_def <= 2) {
$charsa2_def = 2;
}
if ($charsa2_4_def < 1) {
$charsa2_4_def = 1;
}
$charsa2_def = mt_rand($charsa2_4_def, $charsa2_def);
$charsa2_str = $k_starke[1] * 1.8 + $technick2['starke'];
$charsa2_4_str = ($k_starke[1] * 1.8 + $technick2['starke']) + 1;
if ($charsa1_str <= 2) {
$charsa1_str = 2;
}
if ($charsa2_4_str < 1) {
$charsa2_4_str = 1;
}
$charsa2_str = mt_rand($charsa2_4_str, $charsa2_str);
$k_hp[0] = round(($k_hp[0] + $charsa2_def - $charsa2_str +mt_rand(1, 20)));
$schaden_2 = $alt_hp - $k_hp[0];
if ($alt_hp < $k_hp[0]) {
$k_hp[0] = $alt_hp;
$schaden_2 = 0;
}
}
} else {
$schaden_2 = "Keinen Schaden";
}
if (!$technick1['name']) {
$technick1['name'] = 'Normaler Kick';
}
if (!$technick2['name']) {
$technick2['name'] = 'Normaler Kick';
}
if ($k_hp[0] < 0) {
$k_hp7[0] = 0;
} else {
$k_hp7[0] = $k_hp[0];
}
if ($k_mp[0] < 0) {
$k_mp7[0] = 0;
} else {
$k_mp7[0] = $k_mp[0];
}
if ($k_hp[1] < 0) {
$k_hp7[1] = 0;
} else {
$k_hp7[1] = $k_hp[1];
}
if ($k_mp[1] < 0) {
$k_mp7[1] = 0;
} else {
$k_mp7[1] = $k_mp[1];
}
?>

@ -1,30 +0,0 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAMPF MP SPIELER 1
if ($technick1['type'] == 'normal' AND $technick1['mp'] > 0) {
$k_mp[0] = $k_mp[0] - $technick1['mp'];
if ($k_mp[0] < 0) {
$k_hp[0] = $k_hp[0] + ($k_mp[0] * 10);
$k_mp[0] = 0;
}
}
####################KAMPF MP SPIELER 2
if ($technick2['type'] == 'normal' AND $technick2['mp'] > 0) {
$k_mp[1] = $k_mp[1] - $technick2['mp'];
if ($k_mp[1] < 0) {
$k_hp[1] = $k_hp[1] + ($k_mp[1] * 10);
$k_mp[1] = 0;
}
}
?>

@ -1,26 +0,0 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAMPF MPV SPIELER 1
if ($technick1['type'] == 'mpv') {
$k_mp[1] = $k_mp[1] - $technick1['mp'];
if ($k_mp[1] < 0) {
$k_mp[1] = 0;
}
$aktion_AV1[$x] = 'nein';
}
if ($technick2['type'] == 'mpv') {
$k_mp[0] = $k_mp[0] - $technick2['mp'];
if ($k_mp[0] < 0) {
$k_mp[0] = 0;
}
$aktion_AV2[$x] = 'nein';
}
?>

@ -1,100 +0,0 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
################### Spieler 1
$haloo1 = 95;
if ($technick1['type'] == 'tausch') {
if ($k_mp[0] >= $technick1['mp']) {
if ($haloo1 > mt_rand(1, 100)) {
$k_starke_alt[0] = $k_starke[0];
$k_speed_alt[0] = $k_speed[0];
$k_ver_alt[0] = $k_ver[0];
$k_ausdauer_alt[0] = $k_ausdauer[0];
$k_glueck_alt[0] = $k_glueck[0];
$k_hp_alt[0] = $k_hp[0];
$k_starke_alt[1] = $k_starke[1];
$k_speed_alt[1] = $k_speed[1];
$k_ver_alt[1] = $k_ver[1];
$k_ausdauer_alt[1] = $k_ausdauer[1];
$k_glueck_alt[1] = $k_glueck[1];
$k_hp_alt[1] = $k_hp[1];
$k_starke[0] = $k_starke_alt[1];
$k_speed[0] = $k_speed_alt[1];
$k_ver[0] = $k_ver_alt[1];
$k_ausdauer[0] = $k_ausdauer_alt[1];
$k_glueck[0] = $k_glueck_alt[1];
$k_hp[0] = $k_hp_alt[1];
$k_starke[1] = $k_starke_alt[0];
$k_speed[1] = $k_speed_alt[0];
$k_ver[1] = $k_ver_alt[0];
$k_ausdauer[1] = $k_ausdauer_alt[0];
$k_glueck[1] = $k_glueck_alt[0];
$k_hp[1] = $k_hp_alt[0];
} else {
$k_mp[0] = $k_mp[0] - $technick1['mp'];
$schaden_2 = 'Keinen Schaden';
$schaden_1 = 'K&ouml;rpertausch';
}
} else {
$k_mp[0] = $k_mp[0] - $technick1['mp'];
$schaden_2 = 'Keinen Schaden';
$schaden_1 = 'K&ouml;rpertausch fehlgeschlagen';
}
$aktion_AV1[$x] = 'nein';
}
################### Spieler 2
if ($technick2['type'] == 'tausch') {
if ($k_mp[1] >= $technick2['mp']) {
if ($haloo1 > mt_rand(1, 100)) {
$k_starke_alt[0] = $k_starke[0];
$k_speed_alt[0] = $k_speed[0];
$k_ver_alt[0] = $k_ver[0];
$k_ausdauer_alt[0] = $k_ausdauer[0];
$k_glueck_alt[0] = $k_glueck[0];
$k_hp_alt[0] = $k_hp[0];
$k_starke_alt[1] = $k_starke[1];
$k_speed_alt[1] = $k_speed[1];
$k_ver_alt[1] = $k_ver[1];
$k_ausdauer_alt[1] = $k_ausdauer[1];
$k_glueck_alt[1] = $k_glueck[1];
$k_hp_alt[1] = $k_hp[1];
$k_starke[0] = $k_starke_alt[1];
$k_speed[0] = $k_speed_alt[1];
$k_ver[0] = $k_ver_alt[1];
$k_ausdauer[0] = $k_ausdauer_alt[1];
$k_glueck[0] = $k_glueck_alt[1];
$k_hp[0] = $k_hp_alt[1];
$k_starke[1] = $k_starke_alt[0];
$k_speed[1] = $k_speed_alt[0];
$k_ver[1] = $k_ver_alt[0];
$k_ausdauer[1] = $k_ausdauer_alt[0];
$k_glueck[1] = $k_glueck_alt[0];
$k_hp[1] = $k_hp_alt[0];
} else {
$k_mp[1] = $k_mp[1] - $technick2['mp'];
$schaden_1 = 'Keinen Schaden';
$schaden_2 = 'K&ouml;rpertausch';
}
} else {
$k_mp[1] = $k_mp[1] - $technick2['mp'];
$schaden_1 = 'Keinen Schaden';
$schaden_2 = 'K&ouml;rpertausch fehlgeschlagen';
}
$aktion_AV2[$x] = 'nein';
}

@ -9,6 +9,7 @@
include_once(ROOT_PATH.'/include/defines.inc.php'); include_once(ROOT_PATH.'/include/defines.inc.php');
include_once(ROOT_PATH.'/include/clan.inc.php'); include_once(ROOT_PATH.'/include/clan.inc.php');
include_once(ROOT_PATH.'/include/fehlerausgabe.inc.php'); include_once(ROOT_PATH.'/include/fehlerausgabe.inc.php');
include_once(ROOT_PATH.'/include/designfunctions.inc.php');
include_once(ROOT_PATH.'/include/parse.inc.php'); include_once(ROOT_PATH.'/include/parse.inc.php');
include_once(ROOT_PATH.'/include/char.inc.php'); include_once(ROOT_PATH.'/include/char.inc.php');
include_once(ROOT_PATH.'/include/user.inc.php'); include_once(ROOT_PATH.'/include/user.inc.php');
@ -165,8 +166,8 @@ function displayShowChallenge($clan_challenge_id, $user) {
if($user_clan_chars[$i] != null) { if($user_clan_chars[$i] != null) {
$char = getChar($user_clan_chars[$i]); $char = getChar($user_clan_chars[$i]);
$char_owner = getOwnerOfChar($char['id']); $char_owner = getOwnerOfChar($char['id']);
echo '<td align="center"><a href="index.php?as=info&charm=1&char_id='.$char['id'].'">'.$char['name'].'</a> '; echo '<td align="center">'.generateCharLinkByID($char['id']);
echo '(<a href="index.php?as=info&user_id='.$char_owner['id'].'">'.$char_owner['nickname'].'</a>)</td>'; echo '('.generateUserLinkByID($char_owner['id'], FALSE).')</td>';
if(isUserOwnerOf($user['id'], $char['id'])) { if(isUserOwnerOf($user['id'], $char['id'])) {
echo '<td align="center"><a href="index.php?as=clan/kampf_info&action=leavechallenge&challenge='.$clan_challenge_id.'&char='.$char['id'].'">abmelden</a></td>'; echo '<td align="center"><a href="index.php?as=clan/kampf_info&action=leavechallenge&challenge='.$clan_challenge_id.'&char='.$char['id'].'">abmelden</a></td>';
} }
@ -497,10 +498,12 @@ function displayClanFightMenu($user) {
for ($i = 0; $i < $max; $i++) { for ($i = 0; $i < $max; $i++) {
$participating_clan_ids = getParticipatingClanIDs($old_challenge_ids[$i]); $participating_clan_ids = getParticipatingClanIDs($old_challenge_ids[$i]);
$old_challenge = getChallenge($old_challenge_ids[$i]);
foreach ($participating_clan_ids as $pci) foreach ($participating_clan_ids as $pci)
if($pci != $user_clan['id']) { if($pci != $user_clan['id']) {
$challenged_clan = getClan($pci); $challenged_clan = getClan($pci);
echo '<tr><td align="center" colspan="2"> '.$challenged_clan['clanname'].'</td>'; echo '<tr><td align="center"> '.$challenged_clan['clanname'].'</td>';
echo '<td>' .formatTimestamp($old_challenge['date'] ).'</td>';
echo '<td align="center" colspan="3"><a href=\'javascript:showFight('.$old_challenge_ids[$i].');\'>'.anzeigen.'</a></td></tr>'; echo '<td align="center" colspan="3"><a href=\'javascript:showFight('.$old_challenge_ids[$i].');\'>'.anzeigen.'</a></td></tr>';
} }
} }

@ -0,0 +1,208 @@
<?php
/*
*
* @copyright (c) 2011 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include_once(ROOT_PATH.'/include/user.inc.php');
include_once(ROOT_PATH.'/include/parse.inc.php');
include_once(ROOT_PATH.'/include/clan.inc.php');
include_once(ROOT_PATH.'/include/clan_fights.inc.php');
function doTheClanfightTest($acceptTestCase, $amount) {
mysql_query('UPDATE user SET clan = null'); // clean all clans
$ids = getClanFightCapableClanIds();
$row = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM user WHERE 0 < (SELECT COUNT(*) FROM chars WHERE besitzer = user.id)'));
if(count($ids) < $row[0] / MIN_MEMBERS) {
//echo 'We may optimize the user('.$row[0].')/clan('.count($ids).') ratio<br>';
mysql_query('UPDATE user SET clan = null'); // clean all clans
mysql_query('UPDATE clan SET leader = null, co_leader = null');
$sql = 'SELECT id FROM clan ORDER BY ID ASC';
$qry = mysql_query($sql);
while( $row = mysql_fetch_assoc($qry)) {
$sql = 'UPDATE user SET clan = ' .$row['id'] . ' WHERE clan is null AND 0 < (SELECT COUNT(*) FROM chars WHERE besitzer = user.id) LIMIT 5';
//echo $sql . '<br>';
mysql_query($sql);
if(mysql_affected_rows() == 0) {
break;
}
}
$qry = mysql_query('SELECT clan, min(id) as id FROM user WHERE clan is not null GROUP BY clan');
while($row = mysql_fetch_assoc($qry)) {
$sql = 'UPDATE clan SET leader = '.$row['id'].' WHERE id = '.$row['clan'];
//echo $sql . '<br>';
mysql_query($sql);
}
}
mysql_query('DELETE FROM clan_challenge_requests');
mysql_query('DELETE FROM clan_challenges');
mysql_query('DELETE FROM events');
mysql_query('DELETE FROM clan_locked');
$ids = getClanFightCapableClanIds();
if(count($ids) < 2) {
echo "zu wenig Clans die Clanfights machen können " . count($ids);
die();
}
for($i=0;$i<count($ids) - 1;$i+=2) {
calculateClanFight(getClan($ids[$i]), getClan($ids[$i+1]), $acceptTestCase);
}
#$clan1 = getClan($ids[0]);
#$clan2 = getClan($ids[1]);
function calculateClanFight($clan1, $clan2, $acceptTestCase) {
# echo $clan1['id'] . ' ' . $clan2['id'] . ' ' . ($acceptTestCase?'TRUE':'FALSE') . '<br>';
$leaderClan1 = getUser($clan1['leader']);
$leaderClan2 = getUser($clan2['leader']);
$result = challengeClan($leaderClan1, $clan2['id'], $amount);
if($result !== NULL) {
echo $result.'<br>';
}
if(getOpenChallengeRequestCount($clan1['id']) != 1) {
echo 'Fehler: Es sollte mindestens ein Fight offen sein!!<br>';
}
if(getOpenChallengeRequestCount($clan2['id']) != 1) {
echo 'Fehler: Es sollte mindestens ein Fight offen sein!!<br>';
}
if(count(getOpenChallengeRequests($clan1['id'])) != 1) {
echo 'Fehler: Es sollte mindestens ein Fight offen sein!!<br>';
}
if(count(getOpenChallengeRequests($clan2['id'])) != 1) {
echo 'Fehler: Es sollte mindestens ein Fight offen sein!!<br>';
}
$challengeArray = getOpenChallengeRequests($clan2['id']);
if($acceptTestCase) {
$result = acceptChallengeRequest($challengeArray[0]['clan_requester'], $leaderClan2);
if($result !== NULL) {
echo $result.'<br>';
}
if(getOpenChallengeRequestCount($clan1['id']) > 0) {
echo 'Fehler in getOpenChallengeRequestCount: Es sollte kein Fight-Request offen sein!!<br>';
}
if(getOpenChallengeRequestCount($clan2['id']) > 0) {
echo 'Fehler in getOpenChallengeRequestCount: Es sollte kein Fight-Request offen sein!!<br>';
}
if(count(getOpenChallengeRequests($clan1['id'])) > 0) {
echo 'Fehler in getOpenChallengeRequests ('.$clan1['id'].'): Es sollte kein Fight-Request offen sein!!<br>';
}
if(count(getOpenChallengeRequests($clan2['id'])) > 0) {
echo 'Fehler in getOpenChallengeRequests ('.$clan2['id'].'): Es sollte kein Fight-Request offen sein!!<br>';
}
if(count(getOpenChallengeIDs($clan1['id'])) != 1) {
echo 'Fehler: Es sollte mindestens ein Fight offen sein!!<br>';
}
if(count(getOpenChallengeIDs($clan2['id'])) != 1) {
echo 'Fehler: Es sollte mindestens ein Fight offen sein!!<br>';
}
$challengeIDsArray = getOpenChallengeIDs($clan1['id']);
$clan_challenge_id = $challengeIDsArray[0];
if(count(getParticipatingClanIDs($clan_challenge_id)) != 2) {
echo 'Fehler in getParticipatingClanIDs: Es sollten 2 Clans teilnehmen!<br>';
}
// Okay now let the chars participate
$chars1 = getCharsOfUser($leaderClan1['id']);
$chars2 = getCharsOfUser($leaderClan2['id']);
$found = -1;
for($i=0;$i<count($chars1);$i++) {
if($chars1[$i]['status'] == 'Frei') {
$found = $i;
break;
}
}
if($found == -1) {
echo 'Konnte keinen freien Char fuer User ' .$leaderClan1 . ' finden<br>';
}
$result = joinChallenge($clan_challenge_id, $leaderClan1, $chars1[$found]['id'], 1);
if($result !== NULL) {
echo $result .'<br>';
}
$found = -1;
for($i=0;$i<count($chars2);$i++) {
if($chars2[$i]['status'] == 'Frei') {
$found = $i;
break;
}
}
if($found == -1) {
echo 'Konnte keinen freien Char fuer User ' .$leaderClan2 . ' finden<br>';
}
$result = joinChallenge($clan_challenge_id, $leaderClan2, $chars2[$found]['id'], 1);
if($result !== NULL) {
echo $result .'<br>';
}
} else {
$result = denyChallengeRequest($challengeArray[0]['clan_requester'], $leaderClan2);
if($result !== NULL) {
echo $result .'<br>';
}
if(getOpenChallengeRequestCount($clan1['id']) > 0) {
echo 'Fehler in getOpenChallengeRequestCount: Es sollte kein Fight-Request offen sein!!<br>';
}
if(getOpenChallengeRequestCount($clan2['id']) > 0) {
echo 'Fehler in getOpenChallengeRequestCount: Es sollte kein Fight-Request offen sein!!<br>';
}
if(count(getOpenChallengeRequests($clan1['id'])) > 0) {
echo 'Fehler in getOpenChallengeRequests ('.$clan1['id'].'): Es sollte kein Fight-Request offen sein!!<br>';
}
if(count(getOpenChallengeRequests($clan2['id'])) > 0) {
echo 'Fehler in getOpenChallengeRequests ('.$clan2['id'].'): Es sollte kein Fight-Request offen sein!!<br>';
}
}
}
}
?>

@ -244,6 +244,7 @@ function joinClan($user, $clanid, $check_invitation = true){
mysql_query('UPDATE clan SET leader = NULL WHERE leader = ' .$user['id'] . ' and id != ' .$clanid); mysql_query('UPDATE clan SET leader = NULL WHERE leader = ' .$user['id'] . ' and id != ' .$clanid);
mysql_query('UPDATE clan SET co_leader = NULL WHERE co_leader = ' .$user['id'] . ' and id != ' .$clanid); mysql_query('UPDATE clan SET co_leader = NULL WHERE co_leader = ' .$user['id'] . ' and id != ' .$clanid);
mysql_query('DELETE FROM clan_challenge_whitelist WHERE clan_id = ' .$clanid . ' AND user_id = ' .$user['id']); mysql_query('DELETE FROM clan_challenge_whitelist WHERE clan_id = ' .$clanid . ' AND user_id = ' .$user['id']);
mysql_query('DELETE FROM clan_challenge_participants where char_id IN (SELECT id from chars where besitzer = '.$user['id'].') and clan_challenge_id IN (SELECT clan_challenge_id from clan_challenges WHERE calculated = 0)');
if($check_invitation) { if($check_invitation) {
displayErrorMessage('Aufgenommen','Du wurdest erfolgreich in den Clan aufgenommen!','<a href="index.php?as=clan/clan_info">weiter</a>'); displayErrorMessage('Aufgenommen','Du wurdest erfolgreich in den Clan aufgenommen!','<a href="index.php?as=clan/clan_info">weiter</a>');

@ -33,4 +33,13 @@ function getLayerAdvertisement(){
return ''; return '';
} }
function getFlattrHeadCode() {
return '';
}
function getFlattrBodyCode() {
return '';
}
?> ?>

@ -9,11 +9,14 @@
include_once(ROOT_PATH.'/include/defines.inc.php'); include_once(ROOT_PATH.'/include/defines.inc.php');
include_once(ROOT_PATH.'/include/usergroup.inc.php'); include_once(ROOT_PATH.'/include/usergroup.inc.php');
include_once(ROOT_PATH.'/include/config/settings.inc.php'); include_once(ROOT_PATH.'/include/config/settings.inc.php');
include_once(ROOT_PATH.'/include/char.inc.php');
include_once(ROOT_PATH.'/include/sqlwrapper.inc.php');
defineIfNotDefined('GROUP_COLOR_SUPPORTER', 'gold'); defineIfNotDefined('GROUP_COLOR_SUPPORTER', 'gold');
defineIfNotDefined('GROUP_COLOR_GAMEMASTER', 'lime'); defineIfNotDefined('GROUP_COLOR_GAMEMASTER', 'lime');
defineIfNotDefined('GROUP_COLOR_DEVELOPER', 'orange'); defineIfNotDefined('GROUP_COLOR_DEVELOPER', 'orange');
defineIfNotDefined('GROUP_COLOR_CREATIVE', 'red'); defineIfNotDefined('GROUP_COLOR_CREATIVE', 'red');
defineIfNotDefined('GROUP_COLOR_MODERATOR', 'green');
// Diese Funktion muss in ein Darstellungspackage hinein und muss noch verlegt werden, Gestaltung in css-Datei // Diese Funktion muss in ein Darstellungspackage hinein und muss noch verlegt werden, Gestaltung in css-Datei
@ -48,6 +51,8 @@ function generateUserNameByID($userid, $showClanTags = TRUE){
$color = 'style="color:'.GROUP_COLOR_DEVELOPER.'"'; $color = 'style="color:'.GROUP_COLOR_DEVELOPER.'"';
} else if(isUserInGroup($groups, DESIGNER)){ } else if(isUserInGroup($groups, DESIGNER)){
$color = 'style="color:'.GROUP_COLOR_CREATIVE.'"'; $color = 'style="color:'.GROUP_COLOR_CREATIVE.'"';
} else if(isUserInGroup($groups, MODERATOR)){
$color = 'style="color:'.GROUP_COLOR_MODERATOR.'"';
} else { } else {
$color = 'style="color:'.GROUP_COLOR_SUPPORTER.'"'; $color = 'style="color:'.GROUP_COLOR_SUPPORTER.'"';
} }
@ -108,6 +113,25 @@ function displayIndexBackLink(){
return '<a href="index.php">zur&uuml;ck</a>'; return '<a href="index.php">zur&uuml;ck</a>';
} }
function generateCharLinkByID($charid, $showAvatar = FALSE, $showClanTags = FALSE) {
$char = getChar($charid);
$clan_pre = null;
$clan_su = null;
$suffix = null;
if($showClanTags) {
$qry = db_query('select clan.clanz_pre, clan.clanz_suff from user left join clan on user.clan = clan.id where user.id = '.$userid);
$row = mysql_fetch_assoc($qry);
$clan_pre = $row['clanz_pre'];
$clan_su = $row['clanz_suff'];
}
if($showAvatar) {
$suffix = '<br><img src="'.$char['bild'].'" border="0" width="75" height="75">';
}
return '<a href="index.php?as=info&charm=1&char_id='.$charid.'">'.$clan_pre . ' ' . $char['name'] . ' ' . $clan_su . $suffix .'</a>';
}
function displayCharLink($charid, $charname, $img = NULL, $clanpre = NULL, $clansu = NULL){ function displayCharLink($charid, $charname, $img = NULL, $clanpre = NULL, $clansu = NULL){
if($clanpre !== NULL && $clansu !== NULL){ if($clanpre !== NULL && $clansu !== NULL){
$charname = $clanpre.' '.$charname.' '.$clansu; $charname = $clanpre.' '.$charname.' '.$clansu;

@ -19,6 +19,7 @@ defineIfNotDefined('WERBUNG_AN', 5);
defineIfNotDefined('INAKTIV_LOESCHSCHUTZ', 6); defineIfNotDefined('INAKTIV_LOESCHSCHUTZ', 6);
defineIfNotDefined('AKTIV_LOESCHSCHUTZ', 7); defineIfNotDefined('AKTIV_LOESCHSCHUTZ', 7);
defineIfNotDefined('AKTIV_CHAT', 8); defineIfNotDefined('AKTIV_CHAT', 8);
defineIfNotDefined('MODERATOREN', 9);
function getUserGroups($user) { function getUserGroups($user) {
$qry = null; $qry = null;

@ -37,6 +37,13 @@ $agb = $_REQUEST['agb'];
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.php" /> <link rel="alternate" type="application/rss+xml" title="RSS" href="rss.php" />
<script type="text/javascript" src="include/java/ag.js"></script> <script type="text/javascript" src="include/java/ag.js"></script>
<script type="text/javascript" src="include/java/overlib.js"></script> <script type="text/javascript" src="include/java/overlib.js"></script>
<script type="text/javascript">
if (top != self)
top.location = self.location;
</script>
<?php echo getFlattrHeadCode(); ?>
</head>
<?php <?php
// Auskommentieren, wenn Framing doch nicht moeglich sein soll! // Auskommentieren, wenn Framing doch nicht moeglich sein soll!
//<script type="text/javascript"> //<script type="text/javascript">
@ -364,10 +371,46 @@ if($as != "irc" AND $as != "login" AND $as != "anmeldung" AND $as != "info/logs"
</table> </table>
</td> </td>
<td valign="top" width="10"> </td><td valign="top" align="left"> <td valign="top" width="10"> </td><td valign="top" align="left">
<?php
include 'info/agchat.php'; <table cellpadding="0" cellspacing="0" width="146">
?> <tr>
<br> <td height="22" width="146" colspan="3" class="ueberschrift">Support<hr id="hru"></td>
</tr>
<tr>
<td height="29" width="6"> </td>
<td height="29" width="134" valign="top">
<table cellpadding="0" cellspacing="0" width="134">
<tr>
<td height="28" valign="top"><?php echo getFlattrBodyCode(); ?></td>
</tr>
<tr>
<td height="1"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" height="22" width="146" class="ueberschrift" align="left">
Chat<hr id="hru" align="left"></td>
</tr>
<tr>
<td height="29" width="6">&nbsp;</td>
<td height="29" valign="top">
<table cellpadding="0" cellspacing="0">
<tr>
<td height="28" valign="top"><?php include 'info/agchat.php'; ?></td>
</tr>
<tr>
<td height="1"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" width="146"> <table cellpadding="0" cellspacing="0" width="146">
<tr> <tr>
<td height="22" width="146" colspan="3" class="ueberschrift"> <td height="22" width="146" colspan="3" class="ueberschrift">

@ -6,7 +6,6 @@
* *
*/ */
?> ?>
<br><br>
<?php <?php
if (isUserInGroup($usergroups, AKTIV_CHAT)) { if (isUserInGroup($usergroups, AKTIV_CHAT)) {
include_once (ROOT_PATH . '/include/messagefunctions.inc.php'); include_once (ROOT_PATH . '/include/messagefunctions.inc.php');
@ -26,6 +25,5 @@ function popup (url) {
return false; return false;
} }
</script> </script>
<br><br> <br>
<a href="ag_popupchat.php" target="_blank" onclick="return popup(this.href);">Hier klicken zum mitreden!!</a> <a href="ag_popupchat.php" target="_blank" onclick="return popup(this.href);">Hier klicken zum mitreden!!</a>
<br><br>

@ -379,6 +379,13 @@ function displayAutoFights($user, $portal, $pagenum){
</select> </select>
</td> </td>
</tr> </tr>
<tr>
<th id="content" align="center">Falls kein Kampf gefunden wird:</th>
<td id="content" >
<input type="checkbox" name="noname_autofight"/>Autofight ohne Namensbegrenzung<br>
<input type="checkbox" name="create_autofight"/>Kampf erstellen
</td>
</tr>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>

Loading…
Cancel
Save