@ -23,57 +23,79 @@ if(!is_numeric($page) || $page < 1){
$page = $maxpages;
$page = $maxpages;
}
}
?>
// Determine the importance of the Highscores (the less occurece, the more important)
< script >
$qry = db_query('Select count(*) as anzahl, art from highscore where runde = '.($maxpages-$page).' group by art order by anzahl,art asc');
function kampf(id) {
while($row = mysqli_fetch_assoc($qry)){
window.open("./turnier2.php?charm=1&id="+id,"","status=no,hotkeys=no,height=600,width=929,scrollbar=yes");
$events[] = $row;
}
}
< / 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 '< 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";
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
// Now generate the strings
while($row = mysqli_fetch_assoc($qry)){
while($row = mysqli_fetch_assoc($qry)){
if($old != $row['art']){
$art = $row['art'];
$eventhighscore[$row['art']] .= '< tr > '."\n";
if ($name_translation[$art] !== NULL) {
$eventhighscore[$row['art']] .= ' < th class = "content" height = "39" colspan = "3" > '.$row['art'].'< / th > '."\n";
$art = $name_translation[$art];
$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'];
}
}
$eventhighscore[$row['art']] .= '< tr > '."\n";
$events[$art] += 1;
$eventhighscore[$row['art']] .= ' < td class = "content" height = "25" width = "100" align = "center" > '.$row['datum'].'< / td > '."\n";
$eventhighscore[$art] .= '< tr > '."\n";
$eventhighscore[$art] .= ' < td class = "content" height = "25" width = "100" align = "center" > '.$row['datum'].'< / td > '."\n";
if(!is_null($row['charid'])){
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 {
} 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'])){
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{
} 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!!
asort($events);
for($i=0;$i< count ( $ events ) ; $ i + + ) {
echo $eventhighscore[$events[$i]['art']];
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 '< 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 ' < table width = "100%" > '."\n";
echo displayPagelinks($page, $maxpages, $url);
echo displayPagelinks($page, $maxpages, $url);
echo ' < / table > '."\n";
echo ' < / table > '."\n";