Man bekommt nun eine nette Fehlermeldung wenn man die Clan Infoseite oeffnet mit einem Clan der nicht mehr existiert.

main
hecht 13 years ago
parent 7757d20c41
commit 7ea5d22f33

@ -1,104 +1,101 @@
<?php <?php
/* /*
* *
* @copyright (c) 2009 animegame.eu * @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
* *
*/ */
include_once($_SERVER['DOCUMENT_ROOT'].'/ag/include/config.inc.php'); include_once($_SERVER['DOCUMENT_ROOT'].'/ag/include/config.inc.php');
include_once ($_SERVER['DOCUMENT_ROOT'] . '/ag/include/parse.inc.php'); include_once ($_SERVER['DOCUMENT_ROOT'] . '/ag/include/parse.inc.php');
include_once ($_SERVER['DOCUMENT_ROOT'] . '/ag/include/designfunctions.inc.php'); include_once ($_SERVER['DOCUMENT_ROOT'] . '/ag/include/designfunctions.inc.php');
// GET-Section // GET-Section
// Kritisch (SQL-Injections) // Kritisch (SQL-Injections)
//Unkritisch //Unkritisch
$char_name = $_GET['char_name']; $char_name = $_GET['char_name'];
$wahl = $_GET['wahl']; $wahl = $_GET['wahl'];
if ($wahl == 'geld') { if ($wahl == 'geld') {
$wahl_x = 'Geld'; $wahl_x = 'Geld';
} elseif ($wahl == 'siege' OR $wahl == 'niederlagen' OR $wahl == 'unentschieden') { } elseif ($wahl == 'siege' OR $wahl == 'niederlagen' OR $wahl == 'unentschieden') {
$wahl_x= 'Siege'; $wahl_x= 'Siege';
$wahl_y= 'Niederlagen'; $wahl_y= 'Niederlagen';
$wahl_z= 'Unentschieden'; $wahl_z= 'Unentschieden';
} else { } else {
$wahl = 'siege'; $wahl = 'siege';
$wahl_x= 'Siege'; $wahl_x= 'Siege';
$wahl_y= 'Niederlagen'; $wahl_y= 'Niederlagen';
$wahl_z= 'Unentschieden'; $wahl_z= 'Unentschieden';
} }
$char_s = mysql_query('SELECT i.siege, i.leader, i.niederlagen, i.unentschieden, i.geld, i.clanname, i.id, u.nickname, (Select count(*) from user u1 where clan = i.id) as member, (Select 10 - count(*) from user u2 where clan = i.id and ((i.leader is null || i.leader != u2.id) and (i.co_leader is null ||i.co_leader != u2.id))) as freeslots, (select sum(spende) as summe from user_clan where clanid = i.id) as summe FROM clan i LEFT JOIN user u ON(i.leader=u.id) ORDER BY i.'.$wahl.' DESC LIMIT 50'); $char_s = mysql_query('SELECT i.siege, i.leader, i.niederlagen, i.unentschieden, i.geld, i.clanname, i.id, u.nickname, (Select count(*) from user u1 where clan = i.id) as member, (Select 10 - count(*) from user u2 where clan = i.id and ((i.leader is null || i.leader != u2.id) and (i.co_leader is null ||i.co_leader != u2.id))) as freeslots, (select sum(spende) as summe from user_clan where clanid = i.id) as summe FROM clan i LEFT JOIN user u ON(i.leader=u.id) ORDER BY i.'.$wahl.' DESC LIMIT 50');
?> ?>
<html>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="1">
<body> <!-- MSTableType="layout" -->
<tr><th colspan="6">Diese Seite befindet sich gerade im Umbau, daher k&ouml;nnen ein paar Fehler auftreten!</th></tr>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="1"> <tr>
<!-- MSTableType="layout" --> <td valign="middle" colspan="3">
<tr> <p align="center">
<td valign="middle" colspan="3"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get"><br>
<p align="center"> <input type="hidden" name="as" value="clan/c_ranglist" />
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get"><br> <input type="hidden" name="char_name" value="<?php echo $char_name; ?>" />
<input type="hidden" name="as" value="clan/c_ranglist" /> <select id="input" name="wahl">
<input type="hidden" name="char_name" value="<?php echo $char_name; ?>" /> <option value="siege">Siege
<select id="input" name="wahl"> <option value="unentschieden">Unentschieden
<option value="siege">Siege <option value="niederlagen">Niederlagen
<option value="unentschieden">Unentschieden <option value="geld">Geld
<option value="niederlagen">Niederlagen </select>&nbsp;&nbsp;&nbsp;
<option value="geld">Geld <input id="input" type=submit value="ordnen" />
</select>&nbsp;&nbsp;&nbsp; </form>
<input id="input" type=submit value="ordnen" /> </td>
</form> <td valign="middle" colspan="3" height="1">
</td> <p align="center"><b>
<td valign="middle" colspan="3" height="1"> </b></td>
<p align="center"><b> </tr>
</b></td> <tr>
</tr> <th valign="middle" height="25" align="center">#</th>
<tr> <th valign="middle" height="25" align="center" width="20%">Name</th>
<th valign="middle" height="25" align="center">#</th> <th valign="middle" height="25" align="center" width="20%">Leader</th>
<th valign="middle" height="25" align="center" width="20%">Name</th> <th valign="middle" height="25" align="center">Member</th>
<th valign="middle" height="25" align="center" width="20%">Leader</th> <th valign="middle" height="25" align="center">Slots</th>
<th valign="middle" height="25" align="center">Member</th> <?php
<th valign="middle" height="25" align="center">Slots</th> if ($wahl != 'geld') {
<?php echo '<th valign="middle" height="25">'.$wahl_x.'</th>';
if ($wahl != 'geld') { echo '<th valign="middle" height="25">'.$wahl_z.'</th>';
echo '<th valign="middle" height="25">'.$wahl_x.'</th>'; echo '<th valign="middle" height="25">'.$wahl_y.'</th>';
echo '<th valign="middle" height="25">'.$wahl_z.'</th>'; } else {
echo '<th valign="middle" height="25">'.$wahl_y.'</th>'; echo '<th valign="middle" height="25">'.$wahl_x.' Aktuell</th>';
} else { echo '<th validn="middle" height="25">'.$wahl_x.' &#8721;</th>';
echo '<th valign="middle" height="25">'.$wahl_x.' Aktuell</th>'; }
echo '<th validn="middle" height="25">'.$wahl_x.' &#8721;</th>'; ?>
} </tr>
?> <?php
</tr> $x=1;
<?php while($row = mysql_fetch_assoc($char_s)) {
$x=1; echo '<tr>'."\n";
while($row = mysql_fetch_assoc($char_s)) { echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.$x.'</th>'."\n";
echo '<tr>'."\n"; echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center"><a href="index.php?as=clan/clan_info&clan_id='.$row['id'].'">'.$row['clanname'].'</a></th>'."\n";
echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.$x.'</th>'."\n"; echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.displayUserLink($row['leader'], $row['nickname']).'</th>'."\n";
echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center"><a href="index.php?as=clan/clan_info&clan_id='.$row['id'].'">'.$row['clanname'].'</a></th>'."\n"; echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.$row['member'].'</th>'."\n";
echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.displayUserLink($row['leader'], $row['nickname']).'</th>'."\n"; echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.$row['freeslots'].'</th>'."\n";
echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.$row['member'].'</th>'."\n";
echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.$row['freeslots'].'</th>'."\n"; if($wahl == "geld"){
echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.displayMoney($row[$wahl]).'</th>';
if($wahl == "geld"){ echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.displayMoney($row['summe']).'</th>';
echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.displayMoney($row[$wahl]).'</th>'; } else {
echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.displayMoney($row['summe']).'</th>'; echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.displayCount($row[strtolower($wahl_x)]).'</th>';
} else { echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.displayCount($row[strtolower($wahl_z)]).'</th>';
echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.displayCount($row[strtolower($wahl_x)]).'</th>'; echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.displayCount($row[strtolower($wahl_y)]).'</th>';
echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.displayCount($row[strtolower($wahl_z)]).'</th>'; }
echo '<th valign="middle" height="25" bgcolor="'.$cols[$x].'" align="center">'.displayCount($row[strtolower($wahl_y)]).'</th>'; echo '</tr>'."\n";
}
echo '</tr>'."\n"; ?>
?> <?php
$x++;
<?php }
$x++; ?>
} </table>
?>
</table>
</body>

Loading…
Cancel
Save