You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
3.5 KiB

<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/designfunctions.inc.php');
include_once ($_SERVER['DOCUMENT_ROOT'] . 'ag/include/parse.inc.php');
// GET-Section
// Kritisch (SQL-Injections)
$clan_id = validateUnsignedInteger($_GET['clan_id'], null);
//Unkritisch
function displayClanProfile($clanid){
$sql = 'SELECT * FROM clan where clan.id = '.$clanid;
$clan = mysql_fetch_assoc(mysql_query($sql));
$clan_zeichen = explode(",", $clan['clanzeichen']);
$member_qry = mysql_query('Select nickname, id from user where clan = '.$clan['id']);
$count = mysql_num_rows($member_qry);
while($row = mysql_fetch_assoc($member_qry)){
$member[] = displayUserLink($row['id'], $row['nickname'], $clan_zeichen[0], $clan_zeichen[1]);
if($row['id'] == $clan['leader']){
$leader = $row;
} else if($row['id'] == $clan['co_leader']){
$coleader = $row;
}
}
?>
<div align="center">
<table border="0" width="100%" border="1">
<tr>
<th width="100%" height="39" colspan="2" align="center"><?php echo $clan['name']; ?> Info</th>
</tr>
<?php
if($clan['banner'] != "0"){
?>
<tr>
<td width="948" height="52" colspan="2" align="center"><img src="<?php echo $clan['banner']; ?> " width="468" height="60"></td>
</tr>
<?php
}
?>
<tr>
<th width="96" height="25" align="Left">Leader:</th>
<td width="852" height="25"><?php echo $leader['nickname']; ?></td>
</tr>
<tr>
<th width="96" height="25" align="Left">Co-Leader:</th>
<td width="852" height="25"><?php echo $coleader['nickname']; ?></td>
</tr>
<tr>
<th width="96" height="25" align="Left">Clanzeichen:</th>
<td width="852" height="25"><?php echo $clan['clanzeichen']; ?></td>
</tr>
<tr>
<th width="96" height="25" valign="top" align="Left">Member (<?php echo $count; ?>):</th>
<td width="852" height="25"><?php echo join('<br>',$member); ?></td>
</tr>
<tr>
<th width="96" height="25" align="Left">Level:</th>
<td width="852" height="25"><?php echo $clan['level']; ?></td>
</tr>
<tr>
<th width="96" height="25" align="Left">Homepage:</th>
<?php
if($clan['homepage'] != 'Keine'){
echo '<td width="852" height="25"><a href="'.$clan['homepage'].'" target=_blank>'.$clan['homepage'].'</a></td>';
} else{
echo '<td width="852" height="25">Keine</td>';
}
?>
</tr>
<tr>
<th width="96" height="25" valign="top" align="Left">Info:</th>
<td width="852" height="25"><?php echo $clan['info']; ?></td>
</tr>
<tr>
<td width="96" height="25"></td>
<td width="852" height="25"><?php echo displayHistoryBackLink(); ?></td>
</tr>
</table>
</div>
<?php
}
/* Pr<50>fen ob die <20>bergebene oder eingegebene ID eine Zahl ist */
if (!is_numeric($clan_id)) {
echo '<p>Dies ist keine Zahl</p>';
} else {
/* Pr<50>fen ob die <20>bergebene oder eingegebene ID in der Tabelle der Clans vorhanden ist */
$clanvorhanden = mysql_num_rows(mysql_query('SELECT id FROM clan where id = '.$clan_id));
/* Wenn keine Datensatz mit dieser ID vorhanden ist, ist die Variable $clanvorhanden 0 */
if ($clanvorhanden == 0) {
echo '<p>Einen Clan mit dieser ID exisitert nicht!</p>';
/* Wenn es einen Datensatz mit der ID in der Tabelle gibt, werden die Claninformationen angezeigt */
} else {
displayClanProfile($clan_id);
}
}
?>