fix bug in top 50 users

main
hecht 14 years ago
parent 8420146e5e
commit 7c5003abe4

@ -13,7 +13,7 @@ include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/config/settings.inc.php');
// Diese Funktion muss in ein Darstellungspackage hinein und muss noch verlegt werden, Gestaltung in css-Datei
/**
* use displayUserLinkByID instead
* use generateUserLinkByID instead
* @deprecated
*/
function displayUserLink($userid, $username = NULL, $clanpre = NULL, $clansu = NULL){
@ -21,7 +21,15 @@ function displayUserLink($userid, $username = NULL, $clanpre = NULL, $clansu = N
return displayUserLinkByID($userid);
}
/**
* use generateUserNameByID instead
* @deprecated
*/
function displayUserNameByID($userid, $showClanTags = TRUE){
return generateUserNameByID($userid, $showClanTags);
}
function generateUserNameByID($userid, $showClanTags = TRUE){
if($userid === null){return '';}
$groups = getUserGroups($userid);
@ -57,8 +65,15 @@ function displayUserNameByID($userid, $showClanTags = TRUE){
}
}
// Diese Funktion muss in ein Darstellungspackage hinein und muss noch verlegt werden, Gestaltung in css-Datei
/**
* use generateUserLinkByID instead
* @deprecated
*/
function displayUserLinkByID($userid, $showClanTags = TRUE){
return generateUserLinkByID($userid, $showClanTags);
}
function generateUserLinkByID($userid, $showClanTags = TRUE){
return '<a href="index.php?as=info&user_id='.$userid.'">'.displayUserNameByID($userid, $showClanTags).'</a>';
}

@ -38,13 +38,11 @@ function displayHighscore($wahl, $char_name, $user, $char_vorhanden){
}
if($wahl == 'geld') {
$choice_s = mysql_query('SELECT geld, id, nickname FROM user where id >= 2 ORDER BY geld DESC LIMIT 50');
$choice_s = mysql_query('SELECT geld, id FROM user where id >= 2 ORDER BY geld DESC LIMIT 50');
} else {
$sql = 'SELECT cl.clanzeichen, u.nickname, u.id as userid, c.name, c.level, c.besitzer, c.starke, c.preis, c.speed, c.glueck, c.bild, c.verteidigung, c.ausdauer, c.siege, c.niederlagen, c.id as charid, starke+verteidigung+speed+ausdauer+glueck as powerlevel' .
' FROM chars as c INNER JOIN user as u on c.besitzer = u.id' .
' LEFT JOIN clan as cl on u.clan = cl.id ' .
$sql = 'SELECT c.name, c.level, c.besitzer, c.starke, c.preis, c.speed, c.glueck, c.bild, c.verteidigung, c.ausdauer, c.siege, c.niederlagen, c.id as charid, starke+verteidigung+speed+ausdauer+glueck as powerlevel' .
'WHERE rasse != \'NPC\' ORDER BY ('.$wahl.') DESC LIMIT 50';
// Uncomment for hp/mp in PL
// $sql = 'SELECT cl.clanzeichen, u.nickname, u.id as userid, c.name, c.level, c.besitzer, c.starke, c.preis, c.speed, c.glueck, c.bild, c.verteidigung, c.ausdauer, c.siege, c.niederlagen, c.id as charid, starke+verteidigung+speed+ausdauer+glueck+substring_index(hp,\',\',-1)/10+substring_index(mp,\',\',-1)/5 as powerlevel' .
// ' FROM chars as c INNER JOIN user as u on c.besitzer = u.id' .
@ -122,9 +120,9 @@ function displayHighscore($wahl, $char_name, $user, $char_vorhanden){
$cols[$x] = 'bgcolor="#666666"';
$found = 1;
}
$row['bild'] = getPicture($row);
$row['wahl'] = $row[$wahl];
$clan_logo = explode(',',$row['clanzeichen']);
@ -133,7 +131,7 @@ function displayHighscore($wahl, $char_name, $user, $char_vorhanden){
?>
<tr>
<th <?php echo $cols[$x];?> align="center"><?php echo $x; ?></th>
<th <?php echo $cols[$x];?> align="center"><?php echo displayUserLink($row['id'], $row['nickname']); ?></th>
<th <?php echo $cols[$x];?> align="center"><?php echo generateUserLinkByID($row['id']); ?></th>
<th <?php echo $cols[$x];?> align="center">???</th>
</tr>
@ -144,7 +142,7 @@ function displayHighscore($wahl, $char_name, $user, $char_vorhanden){
<tr>
<th <?php echo $cols[$x];?> align="center"><?php echo $x; ?></th>
<th <?php echo $cols[$x];?> align="center"><?php echo displayCharLink($row['charid'],$row['name'],$row['bild']); ?></th>
<th <?php echo $cols[$x];?> align="center"><?php echo displayUserLink($row['besitzer'], $row['nickname'], $clan_logo[0], $clan_logo[1]); ?></b></th>
<th <?php echo $cols[$x];?> align="center"><?php echo generateUserLinkByID($row['besitzer']); ?></th>
<th <?php echo $cols[$x];?> align="center"><?php echo $row['wahl']; ?></th>
<th <?php echo $cols[$x];?> align="center"><?php echo $row['siege'].' / '.$row['niederlagen']; ?></th>
<th <?php echo $cols[$x];?> align="center"><?php echo $row['preis']; ?></th>
@ -172,7 +170,7 @@ function displayHighscore($wahl, $char_name, $user, $char_vorhanden){
<tr>
<th bgcolor="<?php echo $cols[$x];?>" align="center"><?php echo $z; ?></th>
<th bgcolor="<?php echo $cols[$x];?>" align="center"><?php echo displayCharLink($char_x_name['id'],$char_x_name['name'],$char_x_name['bild']); ?></th>
<th bgcolor="<?php echo $cols[$x];?>" align="center"><?php echo displayUserLink($char_x_name['besitzer'],$nick_name2['nickname']); ?></th>
<th bgcolor="<?php echo $cols[$x];?>" align="center"><?php echo generateUserLinkByID($char_x_name['besitzer']); ?></th>
<th bgcolor="<?php echo $cols[$x];?>" align="center"><?php echo $char_x_name[$wahl]; ?></th>
<th bgcolor="<?php echo $cols[$x];?>" align="center"><?php echo $char_x_name['siege'].' / '.$char_x_name['niederlagen']; ?></th>
<th bgcolor="<?php echo $cols[$x];?>" align="center"><?php echo $char_x_name['preis']; ?></th>

Loading…
Cancel
Save