radiskull 13 years ago
parent 75aebd82c5
commit 52931ed83a

@ -1,60 +0,0 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
/*
include_once(ROOT_PATH.'/include/config.inc.php');
include_once(ROOT_PATH.'/include/fehlerausgabe.inc.php');
?>
<body bgcolor="#202020">
<?php
$clan = mysql_fetch_array(mysql_query("SELECT leader, id FROM clan WHERE id='$user_ida[clan]' LIMIT 1"));
$kampfs1 = mysql_query("SELECT * FROM clan_kampf WHERE clan1_id='$clan[id]' OR clan2_id='$clan[id]' ORDER BY id DESC LIMIT 1");
while($kampf1 = mysql_fetch_array($kampfs1)) {
$char_1 = mysql_Fetch_array(mysql_query("SELECT name, hp, mp, bild, besitzer, id FROM chars WHERE id='$kampf1[char1]' LIMIT 1"));
$char_2 = mysql_Fetch_array(mysql_query("SELECT name, hp, mp, bild, besitzer, id FROM chars WHERE id='$kampf1[char2]' LIMIT 1"));
$spleoic = "clan";
$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]);
$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;
// TODO: include_one und danach Funktionsaufruf!!
include(ROOT_PATH.'/include/kampf_anzeige.php');
displayErrorMessage(NULL,$fehler_m,$weiter_an);
}
*/
?>

@ -0,0 +1,254 @@
<html>
<body bgcolor="#008080">
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include_once('../path.inc.php'); // get the path ;)
include_once(ROOT_PATH.'/include/config.inc.php');
include_once(ROOT_PATH.'/include/clan.inc.php');
include_once(ROOT_PATH.'/include/char.inc.php');
include_once(ROOT_PATH.'/include/designfunctions.inc.php');
include_once(ROOT_PATH.'/include/parse.inc.php');
include_once(ROOT_PATH.'/include/fehlerausgabe.inc.php');
// GET-Section
// Kritisch (SQL-Injections)
$challenge_id = validateInteger($_GET['challenge'], null);
// Unkritisch
$action = $_GET['action'];
function getEventChars($challenge_id, $event_id) {
$sql = 'SELECT * FROM clan_challenge_participants ccp INNER JOIN event_chars ec ON ccp.char_id=ec.event_char_id
INNER JOIN event_fights ef ON ccp.slot=ef.event_fight_id
WHERE ccp.clan_challenge_id = '.$challenge_id.' AND ec.event_id= '.$event_id.' AND ef.event_id= '.$event_id.';';
$qry = mysql_query($sql);
$chars = array();
while($row = mysql_fetch_array($qry)) {
$chars[] = $row;
}
return $chars;
}
function getChallengeClans($challenge_id) {
$sql = 'SELECT ccc.id, c.clanname, c.id as clan_id FROM clan_challenge_clans ccc INNER JOIN clan c ON ccc.clan_id=c.id WHERE clan_challenge_id='.$challenge_id.';';
$qry = mysql_query($sql);
$clans = array();
while($row = mysql_fetch_array($qry)) {
$clans[$row['id']] = array('name' => $row['clanname'], 'id' => $row['clan_id']);
}
return $clans;
}
function displayChar($char) {
if($char['visible'] < time()) {
echo '<div style "position:relative; top:0px; left:0px">';
echo '<div style "position:relative; top:0px; left:0px">';
echo '<img src="../'.$char['char_bild'].'" width="75" height="75" border="0">';
echo '</div>';
if($char['event_char_id'] != $char['winner']) {
echo '<div style="position:absolute; top:0px; left:0px; z-index:1">';
echo '<img src="../design/bilder/avatare/Char.gif" width="75" height="75" border="0">';
echo '</div>';
}
echo '</div>';
echo $char['char_name'];
} else {
echo '<img src="../design/bilder/avatare/Char.gif" width="75" height="75" border="0"><br>???';
}
}
function displayHeader($top, $bottom, $challenge) {
$border = 0;
$challenge_id = $challenge['clan_challenge_id'];
$event_id = $challenge['event_id'];
$chars = getEventChars($challenge_id, $event_id);
$clans = getChallengeClans($challenge_id);
echo '<table cellpadding="0" cellspacing="0" width="913" height="0" border="'.$border.'">';
echo '<tr><th valign="top" height="32" colspan="9" align="center">Clankampf am ...</th></tr>';
echo '<tr>';
//erste spalte
echo '<th width="45%" height="32" valign="middle" align="center">'.$clans[0]['name'].'</th>';
//zweite spalte
echo '<td width="5%" valign="middle" align="center" rowspan="3"><b>VS.</b></td>';
//dritte spalte
echo '<th width="45%" height="32" valign="middle" align="center">'.$clans[1]['name'].'</th>';
echo '</tr>';
//obere Teil
echo '<tr height = "150">';
//Darstellen der Bilder auf der linken Seite
echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>';
$width = 100 / $top;
for ($i = 0; $i < $top; $i++) {
echo '<td width="'.$width.'%" valign="middle" align="center">';
if($clans[0]['id'] == $chars[$i]['clan_id']) {
displayChar($chars[$i]);
}
echo '</td>';
}
echo '</tr></table></td>';
//Darstellen der Bilder auf der linken Seite
echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>';
$max = (count($chars)/2)+$top;
$min = (count($chars)/2);
for ($i = $min; $i < $max; $i++) {
echo '<td width="'.$width.'%" valign="middle" align="center">';
if($clans[1]['id'] == $chars[$i]['clan_id']) {
displayChar($chars[$i]);
}
echo '</td>';
}
echo '</tr></table></td>';
echo '</tr>';
//untere Teil
echo '<tr height = "150">';
//Darstellen der Bilder auf der linken Seite
echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>';
$min = $top;
$max = count($chars) / 2;
$width = 100 / $bottom;
for ($i = $min; $i < $max; $i++) {
echo '<td width="'.$width.'%" valign="middle" align="center">';
if($clans[0]['id'] == $chars[$i]['clan_id']) {
displayChar($chars[$i]);
}
echo '</td>';
}
echo '</tr></table></td>';
//Darstellen der Bilder auf der linken Seite
echo '<td><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="'.$border.'"><tr>';
$min = (count($chars)/2)+$top;
$max = count($chars);
for ($i = $min; $i < $max; $i++) {
echo '<td width="'.$width.'%" valign="middle" align="center">';
if($clans[1]['id'] == $chars[$i]['clan_id']) {
displayChar($chars[$i]);
}
echo '</td>';
}
echo '</tr></table></td>';
echo '</tr>';
echo '</table>';
}
function getColor($row) {
if($row % 2 == 0) {
$color = '#018B8B';
//$color = '#FFFFFF';
} else {
$color = '#029393';
//$color = '#FF00FF';
}
return $color;
}
function displayBody($event_id) {
$fight_ids = getEventFightIds($event_id);
$row = 0;
echo '<table cellpadding="0" cellspacing="0" width="913" height="83" border="0">';
foreach($fight_ids as $fight_id) {
$event_fight = getEventFight($event_id, $fight_id);
$round_data = getEventFightRoundData($event_id, $event_fight['event_fight_id'], 0); // get participants of fight
$host_char_id = NULL;
$guest_char_id = NULL;
foreach($round_data as $key => $value) {
if($event_fight['host'] == $key) {
$host_char_id = $key;
} else {
$guest_char_id = $key;
}
}
// Key now lets read out the event_chars ...
$host_char = getEventChar($event_id, $host_char_id);
$guest_char = getEventChar($event_id, $guest_char_id);
// TODO: Check if the fight is already "visible"
echo '<tr><td width="45%" height="15" valign="middle" bgcolor="'.getColor($row).'" align="right">';
echo '<a href="../event_kampf_anzeige.php?event_id='.$event_id.'&event_fight_id='.$event_fight['event_fight_id'].'">';
echo $host_char['char_name'].'</a>';
echo '</td>';
echo '<td width="5%" valign="middle" bgcolor="'.getColor($row).'" align="center">vs</td>';
echo '<td width="45%" valign="middle" bgcolor="'.getColor($row).'" align="left">';
echo '<a href="../event_kampf_anzeige.php?event_id='.$event_id.'&event_fight_id='.$event_fight['event_fight_id'].'">';
echo $guest_char['char_name'].'</a>';
echo '</td></tr>';
$row++;
}
echo '<tr><td height="15" bgcolor="'.getColor($row++).'" colspan="3"> </td></tr>';
echo '<tr><td width="45%" height="15" valign="middle" align="right" bgcolor="'.getColor($row).'">Clan-EXP:</td>';
echo '<td width="5%" valign="middle" align="left" bgcolor="'.getColor($row).'"></td>';
echo '<td width="45%" valign="middle" align="left" bgcolor="'.getColor($row++).'"> 1337</td></tr>';
echo '<tr><td width="45%" height="15" valign="middle" align="right" bgcolor="'.getColor($row).'">Clan-Geld: </td>';
echo '<td width="5%" valign="middle" align="left" bgcolor="'.getColor($row).'"></td>';
echo '<td width="45%" valign="middle" align="left" bgcolor="'.getColor($row++).'"> 1337</td></tr>';
echo '<tr><td width="45%" height="15" valign="middle" align="right" bgcolor="'.getColor($row).'">ELO-Punkte: </td>';
echo '<td width="5%" valign="middle" align="left" bgcolor="'.getColor($row).'"> </td>';
echo '<td width="45%" valign="middle" align="left" bgcolor="'.getColor($row).'"> 1337</td></tr>';
echo '</table>';
}
function displayOverview($challenge_id, $user) {
$user_clan = getClan($user['clan']);
$challenge = getChallenge($challenge_id);
$clans = getParticipatingClanIDs($challenge_id);
if(!in_array($user['clan'] , $clans)) {
displayErrorMessage(NULL, 'Wollte da jemand schummeln? ;)', displayHistoryBackLink());
return;
}
if($challenge['calculated'] == FALSE) {
displayErrorMessage(NULL, 'Der Clankampf ist noch nicht soweit!!', displayHistoryBackLink());
return;
}
$event_id = $challenge['event_id'];
$event = getEvent($event_id);
if($event['event_type'] != EVENT_CLAN_FIGHT) {
displayErrorMessage(NULL, 'Das Event is garkein Clan-Kampf!!', displayHistoryBackLink());
return;
}
//TODO: Kampfbeteiligte ermitteln
//$participating_chars = getEventChars($event_id);
$number_participants = count($participating_chars) / 2;
switch ($challenge['anzahl_chars']) {
case 3:
//not implemented yet!!
break;
case 4:
//not implemented yet!!
break;
case 5:
displayHeader(2, 3, $challenge);
break;
}
displayBody($event_id);
}
switch ($action) {
case 'showsomething':
break;
default:
displayOverview($challenge_id, $user_ida);
break;
}
?>
</body>
</html>

@ -6,7 +6,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/fehlerausgabe.inc.php');
include_once(ROOT_PATH.'/include/parse.inc.php');
@ -369,13 +369,14 @@ function displayClanFightMenuWithClanLocked($user) {
<th height="30" colspan="3" align="center">Herausforderungen</th>
</tr>
<tr>
<th height="30" colspan="3" align="center">Dein Clan ist leider dezeit Blockiert ( <?php
$time = getClanLockedTime($user['clan']);
if($time >= 86400) { // 24*60*60
echo 'Voraussetzungen nicht erf&uuml;llt!!';
} else {
echo generateTimerHtml('blubb', $time, '<a href=\'\'>Blockade beenden</a>');
}
<th height="30" colspan="3" align="center">Dein Clan ist leider
dezeit Blockiert ( <?php
$time = getClanLockedTime($user['clan']);
if($time >= 86400) { // 24*60*60
echo 'Voraussetzungen nicht erf&uuml;llt!!';
} else {
echo generateTimerHtml('blubb', $time, '<a href=\'\'>Blockade beenden</a>');
}
?>)</th>
</tr>
<tr>
@ -436,14 +437,20 @@ function displayClanFightMenu($user) {
$old_challenge_ids = getHistoricalChallengeIDs($user_clan['id']);
?>
<SCRIPT language="JavaScript">
function showFight(challenge_id){
window.open("./clan/kampf_anzeige.php?challenge="+challenge_id,"","status=no,hotkeys=no,Height=600,Width=929,scrollbars=yes");
}
</SCRIPT>
<div align="center">
<table width="100%" border="1">
<tr>
<th height="30" colspan="3" align="center">Herausforderungen</th>
<th height="30" colspan="5" align="center">Herausforderungen</th>
</tr>
<tr>
<th align="Left" height="25">Clan herausfordern</th>
<td>
<th align="Left" height="25" colspan="2">Clan herausfordern</th>
<td colspan="3">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="GET">
<input type="hidden" name="as" value="clan/kampf_info"> <input
type="hidden" name="action" value="challengeclan"> <select
@ -459,49 +466,43 @@ function displayClanFightMenu($user) {
</td>
</tr>
<tr>
<td colspan="3">
<table width="100%" border="1">
<tr>
<th align="center" height="25">Clan</th>
<th align="center" height="25">Datum</th>
<th align="center" height="25">Typ</th>
<th align="center" height="25">Anzahl</th>
<th align="center" height="25">Status</th>
</tr>
<tr>
<?php
if(count($open_challenge_requests) == 0) {
echo '<td align ="center" colspan="5" height="20">Keine</td>';
} else {
foreach ($open_challenge_requests as $challenge) {
$requester_clan = getClan($challenge['clan_requester']);
$challenged_clan = getClan($challenge['clan_challenged']);
//unterscheidung zwischen herausforder und herausgeforderter
if($user_clan['id'] == $challenge['clan_requester']) {
echo '<tr><td align ="center">'.$challenged_clan['clanname'].'</td><td align ="center">'.formatTimestamp($challenge['challenged_time']).'</td>';
echo '<td align ="center">'.getFightType($challenge['type']).'</td><td align ="center">'.$challenge['anzahl_chars'].'</td>';
echo '<td align ="center">ausstehend (<a href="index.php?as=clan/kampf_info&action=q_withdrawclanchallenge&clanid='.$challenged_clan['id'].'">zur&uuml;ckziehen</a>)</td></tr>';
} else {
echo '<tr><td align ="center">'.$requester_clan['clanname'].'</td><td align ="center">'.formatTimestamp($challenge['challenged_time']).'</td>';
echo '<td align ="center">'.getFightType($challenge['type']).'</td><td align ="center">'.$challenge['anzahl_chars'].'</td>';
echo '<td align ="center"><a href="index.php?as=clan/kampf_info&action=acceptclanchallenge&clanid='.$requester_clan['id'].'">annehmen</a> |';
echo '<a href="index.php?as=clan/kampf_info&action=q_denyclanchallenge&clanid='.$requester_clan['id'].'">ablehnen</a></td></tr>';
}
}
}
?>
</tr>
</table>
</td>
<th align="center" height="25">Clan</th>
<th align="center" height="25">Datum</th>
<th align="center" height="25">Typ</th>
<th align="center" height="25">Anzahl</th>
<th align="center" height="25">Status</th>
</tr>
<tr>
<th height="30" colspan="3" align="center">offene Herausforderungen</th>
<?php
if(count($open_challenge_requests) == 0) {
echo '<td align ="center" colspan="5" height="20">Keine</td>';
} else {
foreach ($open_challenge_requests as $challenge) {
$requester_clan = getClan($challenge['clan_requester']);
$challenged_clan = getClan($challenge['clan_challenged']);
//unterscheidung zwischen herausforder und herausgeforderter
if($user_clan['id'] == $challenge['clan_requester']) {
echo '<tr><td align ="center">'.$challenged_clan['clanname'].'</td><td align ="center">'.formatTimestamp($challenge['challenged_time']).'</td>';
echo '<td align ="center">'.getFightType($challenge['type']).'</td><td align ="center">'.$challenge['anzahl_chars'].'</td>';
echo '<td align ="center">ausstehend (<a href="index.php?as=clan/kampf_info&action=q_withdrawclanchallenge&clanid='.$challenged_clan['id'].'">zur&uuml;ckziehen</a>)</td></tr>';
} else {
echo '<tr><td align ="center">'.$requester_clan['clanname'].'</td><td align ="center">'.formatTimestamp($challenge['challenged_time']).'</td>';
echo '<td align ="center">'.getFightType($challenge['type']).'</td><td align ="center">'.$challenge['anzahl_chars'].'</td>';
echo '<td align ="center"><a href="index.php?as=clan/kampf_info&action=acceptclanchallenge&clanid='.$requester_clan['id'].'">annehmen</a> |';
echo '<a href="index.php?as=clan/kampf_info&action=q_denyclanchallenge&clanid='.$requester_clan['id'].'">ablehnen</a></td></tr>';
}
}
}
?>
</tr>
<tr>
<th height="30" colspan="5" align="center">offene Herausforderungen</th>
</tr>
<tr>
<?php
if(count($open_challenge_ids) == 0) {
echo '<td height="20" colspan="2" align="center">Keine</td>';
echo '<td height="20" colspan="5" align="center">Keine</td>';
} else {
foreach ($open_challenge_ids as $oci) {
$participating_clan_ids = getParticipatingClanIDs($oci);
@ -509,8 +510,8 @@ function displayClanFightMenu($user) {
if($pci != $user_clan['id']) {
$challenged_clan = getClan($pci);
echo '<tr>';
echo '<td> '.$challenged_clan['clanname'].'</td>';
echo '<td align="center"><a href="index.php?as=clan/kampf_info&action=showchallenge&challenge='.$oci.'">'.anzeigen.'</a></td>';
echo '<td colspan="2"> '.$challenged_clan['clanname'].'</td>';
echo '<td align="center" colspan="2"><a href="index.php?as=clan/kampf_info&action=showchallenge&challenge='.$oci.'">'.anzeigen.'</a></td>';
echo '<td align="center"><a href="index.php?as=clan/kampf_info&action=q_cancelclanchallenge&challenge='.$oci.'">'.abbrechen.'</a></td>';
echo '</tr>';
}
@ -519,39 +520,39 @@ function displayClanFightMenu($user) {
?>
</tr>
<tr>
<th height="30" colspan="3" align="center">Laufende Herausforderungen</th>
<th height="30" colspan="5" align="center">Laufende Herausforderungen</th>
</tr>
<?php
if(count($active_clan_challange_ids) == 0) {
echo '<td height="20" colspan="3" align="center">Keine</td>';
echo '<td height="20" colspan="5" align="center">Keine</td>';
} else {
foreach ($active_clan_challange_ids as $acci) {
$participating_clan_ids = getParticipatingClanIDs($acci);
foreach ($participating_clan_ids as $pci)
if($pci != $user_clan['id']) {
$challenged_clan = getClan($pci);
echo '<tr><td align="center"> '.$challenged_clan['clanname'].'</td>';
echo '<tr><td align="center" colspan="2"> '.$challenged_clan['clanname'].'</td>';
//TODO: hier muss javascript fenster aufgerufen werden
echo '<td align="center"><a href="index.php?as=clan/kampf_info&action=showoldchallenge&challenge='.$acci.'">'.anzeigen.'</a></td></tr>';
echo '<td align="center" colspan="3"><a href="index.php?as=clan/kampf_info&action=showoldchallenge&challenge='.$acci.'">'.anzeigen.'</a></td></tr>';
}
}
}
?>
<tr>
<th height="30" colspan="3" align="center">Beendete Herausforderungen</th>
<th height="30" colspan="5" align="center">Beendete Herausforderungen</th>
</tr>
<tr>
<?php
if(count($old_challenge_ids) == 0) {
echo '<td height="20" colspan="3" align="center">Keine</td>';
echo '<td height="20" colspan="5" align="center">Keine</td>';
} else {
foreach ($old_challenge_ids as $oci) {
$participating_clan_ids = getParticipatingClanIDs($oci);
foreach ($participating_clan_ids as $pci)
if($pci != $user_clan['id']) {
$challenged_clan = getClan($pci);
echo '<tr><td> '.$challenged_clan['clanname'].'</td>';
echo '<td align="center"><a href="index.php?as=clan/kampf_info&action=showoldchallenge&challenge='.$oci.'">'.anzeigen.'</a></td></tr>';
echo '<tr><td align="center" colspan="2"> '.$challenged_clan['clanname'].'</td>';
echo '<td align="center" colspan="3"><a href=\'javascript:showFight('.$oci.');\'>'.anzeigen.'</a></td></tr>';
}
}
}

@ -63,20 +63,6 @@ if ($name AND $passwort) {
<a href=index.php?as=clan/add>Clan Beitreten</a><br>";
} else {
?>
<SCRIPT language="JavaScript">
function showgames(){
var Info = window.open("./clan/kampf_list.php","","status=no,hotkeys=no,Height=600,Width=820,scrollbars=yes");
}
function pkampf(){
var Info = window.open("c_kampf_anzeige.php","","status=no,hotkeys=no,Height=600,Width=820,scrollbars=yes");
}
</SCRIPT>
<?php
$clan_009 = "
<a href=index.php?as=clan/clan_info>Mein Clan</a><br>

@ -55,8 +55,8 @@ $turnier_info = mysql_query('SELECT win, char1, char2, id, round, dauer FROM tur
$dauer[] = $row['dauer'];
if(($pl * $u) + $dauer[0] < time()) {
$char_nic1[]='<img src="'.$char_info1['bild'].'" width="75" height="75" border="0"><br>'.$char_info1[name];
$char_nic2[]='<img src="'.$char_info2['bild'].'" width="75" height="75" border="0"><br>'.$char_info2[name];
$char_nic1[]='<img src="'.$char_info1['bild'].'" width="75" height="75" border="0"><br>'.$char_info1['name'];
$char_nic2[]='<img src="'.$char_info2['bild'].'" width="75" height="75" border="0"><br>'.$char_info2['name'];
} else {
$char_nic1[]='<img src="design/bilder/avatare/Char.gif" width="75" height="75" border="0"><br>???';
$char_nic2[]='<img src="design/bilder/avatare/Char.gif" width="75" height="75" border="0"><br>???';
@ -93,8 +93,8 @@ if(($pl * $max_turnier) + $dauer[0] < time()) {
?>
<tr>
<td width="900" height="150" colspan="8" valign="middle" align="center">
<img src="<?php echo $win_char[bild]; ?>" width="75" height="75">
<br><?php echo $win_char[name]; ?>
<img src="<?php echo $win_char['bild']; ?>" width="75" height="75">
<br><?php echo $win_char['name']; ?>
</td>
</tr>
<?php

Loading…
Cancel
Save