@ -23,57 +23,79 @@ if(!is_numeric($page) || $page < 1){
$page = $maxpages;
}
?>
// Determine the importance of the Highscores (the less occurece, the more important)
$qry = db_query('Select count(*) as anzahl, art from highscore where runde = '.($maxpages-$page).' group by art order by anzahl,art asc');
while($row = mysqli_fetch_assoc($qry)){
$events[] = $row;
}
< script >
function kampf(id) {
window.open("./turnier2.php?charm=1&id="+id,"","status=no,hotkeys=no,height=600,width=929,scrollbar=yes");
}
< / script >
$qry = db_query('Select * from highscore where runde = '.($maxpages-$page).' order by art, datum');
<?php
$qry = db_query('Select * from highscore where runde = '.($maxpages-$page).' order by datum');
echo '< table cellpadding= "0" cellspacing = "0" width = "100%" height = "69" > '."\n";
echo '< table border= "0" cellpadding= "0" cellspacing = "0" width = "100%" height = "69" > '."\n";
echo '< tr > '."\n";
echo ' < th class = "content" colspan = " 3 "> Halle der Helden aus Runde '.($maxpages - $page).'< / th > '."\n";
echo ' < th class = "content" colspan = " 4 "> Halle der Helden aus Runde '.($maxpages - $page).'< / th > '."\n";
echo '< / tr > '."\n";
$name_translation = array(
'klein' => 'Anfä ngerturnier',
'gross' => 'Weltturnier',
'grossst' => 'Weltturnier Non-Fusion',
'wochen' => 'Wochenturnier',
'wochenst' => 'Wochenturnier Non-Fusion'
);
$eventhighscore = array();
$events = array();
// Now generate the strings
while($row = mysqli_fetch_assoc($qry)){
if($old != $row['art']){
$eventhighscore[$row['art']] .= '< tr > '."\n";
$eventhighscore[$row['art']] .= ' < th class = "content" height = "39" colspan = "3" > '.$row['art'].'< / th > '."\n";
$eventhighscore[$row['art']] .= '< / tr > '."\n";
$eventhighscore[$row['art']] .= '< tr > '."\n";
$eventhighscore[$row['art']] .= ' < th class = "content" height = "22" width = "100" align = "center" > Datum< / th > '."\n";
$eventhighscore[$row['art']] .= ' < th class = "content" height = "22" width = "100" align = "center" > Sieger< / th > '."\n";
$eventhighscore[$row['art']] .= ' < th class = "content" height = "22" width = "100" align = "center" > Trainer< / th > '."\n";
$eventhighscore[$row['art']] .= '< / tr > '."\n";
$old = $row['art'];
$art = $row['art'];
if ($name_translation[$art] !== NULL) {
$art = $name_translation[$art];
}
$eventhighscore[$row['art']] .= '< tr > '."\n";
$eventhighscore[$row['art']] .= ' < td class = "content" height = "25" width = "100" align = "center" > '.$row['datum'].'< / td > '."\n";
$events[$art] += 1;
$eventhighscore[$art] .= '< tr > '."\n";
$eventhighscore[$art] .= ' < td class = "content" height = "25" width = "100" align = "center" > '.$row['datum'].'< / td > '."\n";
if(!is_null($row['charid'])){
$eventhighscore[$row['art']] .= ' < td class = "content" height = "25" width = "100" align = "center" > '.displayCharLink($row['charid'], $row['charname']).'< / td > '."\n";
$eventhighscore[$art] .= ' < td class = "content" height = "25" width = "100" align = "center" > '.displayCharLink($row['charid'], $row['charname']).'< / td > '."\n";
} else {
$eventhighscore[$row[' art'] ] .= ' < td class = "content" height = "25" width = "100" align = "center" > '.$row['charname'].'< / td > '."\n";
$eventhighscore[$art] .= ' < td class = "content" height = "25" width = "100" align = "center" > '.$row['charname'].'< / td > '."\n";
}
if(!is_null($row['userid'])){
$eventhighscore[$row[' art'] ] .= ' < td class = "content" height = "25" width = "100" align = "center" > '.displayUserLink($row['userid'], $row['username']).'< / td > '."\n";
$eventhighscore[$art] .= ' < td class = "content" height = "25" width = "100" align = "center" > '.displayUserLink($row['userid'], $row['username']).'< / td > '."\n";
} else{
$eventhighscore[$row[' art'] ] .= ' < td class = "content" height = "25" width = "100" align = "center" > '.$row['username'].'< / td > '."\n";
$eventhighscore[$art] .= ' < td class = "content" height = "25" width = "100" align = "center" > '.$row['username'].'< / td > '."\n";
}
$eventhighscore[$row['art']] .= '< / tr > '."\n";
if(!is_null($row['tournament_id'])) {
$eventhighscore[$art] .= ' < td class = "content" height = "25" width = "100" align = "center" > < a href = "javascript:kampf('.$row['tournament_id'].');" > Turnier anzeigen< / a > < / td > '."\n";
}
$eventhighscore[$art] .= '< / tr > '."\n";
}
// Now echo the stuff!!
for($i=0;$i< count ( $ events ) ; $ i + + ) {
echo $eventhighscore[$events[$i]['art']];
asort($events);
foreach ($events as $key => $value) {
echo '< tr > '."\n";
echo ' < th class = "content" height = "39" colspan = "4" > '.$key.'< / th > '."\n";
echo '< / tr > '."\n";
echo '< tr > '."\n";
echo ' < th class = "content" height = "22" width = "100" align = "center" > Datum< / th > '."\n";
echo ' < th class = "content" height = "22" width = "100" align = "center" > Sieger< / th > '."\n";
echo ' < th class = "content" height = "22" width = "100" align = "center" > Trainer< / th > '."\n";
echo '< / tr > '."\n";
echo $eventhighscore[$key];
}
echo '< tr > '."\n";
echo ' < td align = "center" valign = "bottom" height = "22" width = "100%" colspan = "3" > '."\n";
echo ' < td align = "center" valign = "bottom" height = "22" width = "100%" colspan = " 4 "> '."\n";
echo ' < table width = "100%" > '."\n";
echo displayPagelinks($page, $maxpages, $url);
echo ' < / table > '."\n";