LoGD Standardrelease steht hier zum Download zur Verfügung!
<?php
// 25052004
// New Hall of Fame features by anpera
// http://www.anpera.net/forum/viewforum.php?f=27
// with code from centralserver for 0.9.8; re-imported to 0.9.7
/*
2024-05-04 aragon code cleanup
*/
require_once "common.php";
page_header("Ruhmeshalle");
checkday();
$playersperpage = 50;
$op = $_GET['op'] ?? "kills";
$subop = $_GET['subop'] ?? "most";
$sql = "SELECT count(acctid) AS c FROM accounts WHERE locked=0";
if ($op == "kills") {
$sql = "SELECT count(acctid) AS c FROM accounts WHERE locked=0 AND dragonkills>0";
} elseif ($op == "days") {
$sql = "SELECT count(acctid) AS c FROM accounts WHERE locked=0 AND dragonkills>0 AND bestdragonage>0";
}
$result = db_query($sql);
$row = db_fetch_assoc($result);
$totalplayers = $row['c'];
$page = (int)($_GET['page'] ?? 1);
$pageoffset = $page;
if ($pageoffset > 0) {
$pageoffset--;
}
$pageoffset *= $playersperpage;
$from = $pageoffset + 1;
$to = min($pageoffset + $playersperpage, $totalplayers);
$limit = "$pageoffset,$playersperpage";
addnav("Bestenlisten");
addnav("Drachenkills", "hof.php?op=kills&subop=$subop&page=$page");
addnav("Reichtum", "hof.php?op=money&subop=$subop&page=$page");
addnav("Edelsteine", "hof.php?op=gems&subop=$subop&page=$page");
addnav("Schönheit", "hof.php?op=charm&subop=$subop&page=$page");
addnav("Stärke", "hof.php?op=tough&subop=$subop&page=$page");
addnav("Schlagkraft", "hof.php?op=punch&subop=$subop&page=$page");
addnav("Tollpatsche", "hof.php?op=resurrects&subop=$subop&page=$page");
addnav("Geschwindigkeit", "hof.php?op=days&subop=$subop&page=$page");
#addnav("Wohnviertelerfolge", "hof.php?op=killedinwohnviertel&subop=$subop&page=$page");
#addnav("Wohnviertelverlierer", "hof.php?op=diedinwohnviertel&subop=$subop&page=$page");
addnav("Arenapunkte", "hof.php?op=battlepoints&subop=$subop&page=$page");
if ($session['user']['alive'] == 0) addnav("Ramius' Lieblinge", "hof.php?op=grave&subop=$subop&page=$page");
addnav("Sortieren nach");
addnav("Besten", "hof.php?op=$op&subop=most&page=$page");
addnav("Schlechtesten", "hof.php?op=$op&subop=least&page=$page");
addnav("Seiten");
for ($i = 0; $i < $totalplayers; $i += $playersperpage) {
$pnum = ($i / $playersperpage + 1);
$min = ($i + 1);
$max = min($i + $playersperpage, $totalplayers);
addnav("Seite $pnum ($min-$max)", "hof.php?op=$op&subop=$subop&page=$pnum");
}
addnav("Sonstiges");
addnav("Paare dieser Welt", "hof.php?op=paare");
if ($session['user']['alive']) {
addnav("Zurück zum Dorf", "village.php");
} else {
addnav("Zurück zu den Schatten", "shades.php");
}
function display_table($title, $sql, $none = false, $foot = false, $data_header = [], $tag = false)
{
global $session, $from, $to, $page;
output("`c`b`^$title`0`b `7(Seite $page: $from-$to)`0`n`n`c");
output('<table cellspacing="0" cellpadding="2" align="center" border=0>', true);
output("<tr><td>Hintergrundfarben: </td><td bgcolor='#433828'>Freunde</td><td bgcolor='#005500'>Du selbst</td></tr></table><br>", true);
output('<table cellspacing="0" cellpadding="2" align="center"><tr class="trhead">', true);
output("<td>`bRang`b</td><td>`bName`b</td>", true);
if ($data_header !== false) {
for ($i = 0; $i < count($data_header); $i++) {
output("<td>`b" . $data_header[$i] . "`b</td>", true);
}
}
$result = db_query($sql) or die(db_error(LINK));
if (db_num_rows($result) == 0) {
$size = ($data_header === false) ? 2 : 2 + count($data_header);
//echo $size;
if ($none === false) $none = "Keine Spieler gefunden";
output('<tr class="trlight"><td colspan="' . $size . '" align="center">`&' . $none . '`0</td></tr>', true);
} else {
$resf = db_query("SELECT friend FROM friendlist WHERE acctid=" . $session['user']['acctid'] . ";");
$friendlist = array();
if (db_num_rows($resf) > 0)
while ($rowf = db_fetch_assoc($resf))
array_push($friendlist, $rowf['friend']);
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
$a = $row['acctid'];
$b = $session['user'];
if ($row['name'] == $b['name']) {
//output("<tr class='hilight'>",true);
output("<tr bgcolor='#005500'>", true);
# } elseif ($a==$b['friend1'] || $a==$b['friend2'] || $a==$b['friend3'] || $a==$b['friend4'] || $a==$b['friend5'] || $a==$b['friend6'] || $a==$b['friend7'] || $a==$b['friend8'] || $a==$b['friend9'] || $a==$b['friend10']){
} elseif (in_array($a, $friendlist)) {
output("<tr bgcolor='#433828'>", true);
} else {
output('<tr class="' . ($i % 2 ? "trlight" : "trdark") . '">', true);
}
output("<td>" . ($i + $from) . ".</td><td>`&{$row['name']}`0</td>", true);
if ($data_header !== false) {
for ($j = 0; $j < count($data_header); $j++) {
$id = "data" . ($j + 1);
$val = $row[$id];
if ($tag !== false) $val = $val . " " . $tag[$j];
output("<td align='right'>$val</td>", true);
}
}
output("</tr>", true);
}
}
output("</table>", true);
if ($foot !== false) output("`n`c$foot`c");
}
$order = "DESC";
if ($subop == "least") $order = "ASC";
$sexsel = "IF(sex,'<img src=\"images/female.gif\" /> ','<img src=\"images/male.gif\" /> ')";
//$racesel = "CASE race WHEN 1 THEN '`2Troll`0' WHEN 2 THEN '`^Elf`0' WHEN 3 THEN '`&Mensch`0' WHEN 4 THEN '`#Zwerg`0' WHEN 5 THEN '`5Echse`0' ELSE '`7Unbekannt`0' END";
if ($op == "money") {
$sql = "SELECT acctid,accounts.name,CAST(goldinbank+gold AS signed) AS data1 FROM accounts WHERE locked=0 ORDER BY data1 $order, level $order, experience $order, acctid $order LIMIT $limit;";
$adverb = "reichsten";
if ($subop == "least") $adverb = "ärmsten";
$title = "Die $adverb Krieger in diesem Land";
$foot = "(Vermögen +/- 5%)";
$headers = array("Geschätztes Vermögen");
$tags = array("Gold");
display_table($title, $sql, false, $foot, $headers, $tags);
} elseif ($op == "gems") {
$sql = "SELECT acctid,accounts.name FROM accounts WHERE locked=0 ORDER BY gems $order, level $order, experience $order, acctid $order LIMIT $limit";
if ($subop == "least") $adverb = "wenigsten";
else $adverb = "meisten";
$title = "Die Krieger mit den $adverb Edelsteinen";
display_table($title, $sql);
} elseif ($op == "charm") {
$sql = "SELECT acctid,accounts.name,$sexsel AS data1, CONCAT(r.colorname,'`0') AS data2 FROM accounts LEFT JOIN race r ON r.name=accounts.race WHERE locked=0 ORDER BY charm $order, level $order, experience $order, acctid $order LIMIT $limit";
$adverb = "schönsten";
if ($subop == "least") $adverb = "hässlichsten";
$title = "Die $adverb Krieger in diesem Land.";
$headers = array("<img src=\"images/female.gif\" />/<img src=\"images/male.gif\" />", "Rasse");
display_table($title, $sql, false, false, $headers, false);
} elseif ($op == "tough") {
$sql = "SELECT acctid,accounts.name,level AS data2, CONCAT(r.colorname,'`0') AS data1 FROM accounts LEFT JOIN race r ON r.name=accounts.race WHERE locked=0 ORDER BY maxhitpoints $order, level $order, experience $order, acctid $order LIMIT $limit";
$adverb = "stärksten";
if ($subop == "least") $adverb = "schwächsten";
$title = "Die $adverb Krieger in diesem Land";
$headers = array("Rasse", "Level");
display_table($title, $sql, false, false, $headers, false);
} elseif ($op == "punch") {
$sql = "SELECT acctid,accounts.name,punch AS data1, CONCAT(r.colorname,'`0') AS data2 FROM accounts LEFT JOIN race r ON r.name=accounts.race WHERE locked=0 ORDER BY data1 $order, level $order, experience $order, acctid $order LIMIT $limit";
$adverb = "härtesten";
if ($subop == "least") $adverb = "armseligsten";
$title = "Die $adverb Schläge aller Zeiten";
$headers = array("Punkte", "Rasse");
display_table($title, $sql, false, false, $headers, false);
} elseif ($op == "resurrects") {
$sql = "SELECT acctid,accounts.name,level AS data1 FROM accounts WHERE locked=0 ORDER BY resurrections $order, level $order, experience $order, acctid $order LIMIT $limit";
$adverb = "tollpatschigsten";
if ($subop == "least") $adverb = "geschicktesten";
$title = "Die $adverb Krieger in diesem Land";
$headers = array("Level");
display_table($title, $sql, false, false, $headers, false);
} elseif ($op == "grave") {
$sql = "SELECT acctid,accounts.name,deathpower,location,loggedin,laston,alive,invisible FROM accounts WHERE locked=0 ORDER BY deathpower $order, level $order, experience $order, acctid $order LIMIT $limit";
$adverb = "fleissigste";
if ($subop == "least") {
$adverb = "faulste";
}
$title = "Ramius' $adverb Krieger";
output("`c`b`^$title`0`b `7(Seite $page: $from-$to)`0`c`n");
output('<table cellspacing="0" cellpadding="2" align="center"><tr class="trhead">', true);
output("<td>`bRang`b</td><td>`bName`b</td><td>`bGefallen`b</td><td>`bOrt`b</td><td>`bStatus`b</td></tr>", true);
$result = db_query($sql) or die(db_error(LINK));
if (db_num_rows($result) == 0) {
output('<tr class="trlight"><td colspan="5" align="center">`&Keine Spieler gefunden`0</td></tr>', true);
} else {
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
if ($row['name'] == $session['user']['name']) {
//output("<tr class='hilight'>",true);
output("<tr bgcolor='#005500'>", true);
} else {
output('<tr class="' . ($i % 2 ? "trlight" : "trdark") . '">', true);
}
output("<td>" . ($i + $from) . ".</td><td>`&{$row['name']}`0</td><td align='right'>`){$row['deathpower']}`0</td><td>", true);
$loggedin = (date("U") - strtotime($row['laston']) < getsetting("LOGINTIMEOUT", 900) && $row['loggedin']);
$invisible = $row['invisible'];
if ($row['location'] == 0) {
if ($invisible == '0') {
output($loggedin ? "`#Online`0" : "`3Die Felder`0");
} else {
output("`3Die Felder`0");
}
}
if ($row['location'] == 1) {
output("`3Zimmer in Kneipe`0");
}
if ($row['location'] == 2) {
output("`3Im Haus`0");
}
output("</td><td>", true);
output($row['alive'] ? "`1Lebt`0" : "`4Tot`0");
output("</td></tr>", true);
}
}
output("</table>", true);
} elseif ($op == "days") {
$order = "ASC";
if ($subop == "least") {
$order = "DESC";
}
$sql = "SELECT acctid,name, IF(bestdragonage,bestdragonage,'Unknown') AS data1 FROM accounts WHERE dragonkills>0 AND locked=0 AND bestdragonage>0 ORDER BY bestdragonage $order, level $order, experience $order, acctid $order LIMIT $limit";
$adverb = "schnellsten";
if ($subop == "least") {
$adverb = "langsamsten";
}
$title = "Helden mit den $adverb Drachenkills";
$headers = array("Bestzeit Tage");
$none = "Es gibt noch keine Helden in diesem Land";
display_table($title, $sql, $none, false, $headers, false);
} elseif ($op == "battlepoints") {
$sql = "SELECT acctid,name,battlepoints AS data1,dragonkills AS data2 FROM accounts WHERE locked=0 ORDER BY battlepoints $order, dragonkills $order, acctid $order LIMIT $limit";
$adverb = "besten";
if ($subop == "least") {
$adverb = "schlechtesten";
}
$title = "Die $adverb Arenakämpfer in diesem Land";
$headers = array("Punkte", "Drachenkills");
display_table($title, $sql, false, false, $headers, false);
} elseif ($op == "paare") {
output("In einem Nebenraum der Ruhmeshalle findest du eine Liste mit Helden ganz anderer Art. Diese Helden meistern gemeinsam die Gefahren der Ehe!`n`n");
$sql = "SELECT a1.name AS male_name, a2.name AS female_name FROM accounts a1 LEFT JOIN accounts a2 ON a1.marriedto=a2.acctid WHERE a1.sex=0 AND a1.charisma=4294967295 ORDER BY a1.acctid DESC";
output("`c`b`&Heldenpaare dieser Welt`b`c`n");
output("<table cellspacing=0 cellpadding=2 align='center'><tr><td><img src=\"images/female.gif\" />`b Name`b</td><td></td><td><img src=\"images/male.gif\" />`b Name`b</td></tr>", true);
$result = db_query($sql) or die(db_error(LINK));
if (db_num_rows($result) == 0) {
output("<tr><td colspan=4 align='center'>`&`iIn diesem Land gibt es keine Paare`i`0</td></tr>", true);
}
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
//$sql2 = "SELECT acctid,name FROM accounts WHERE acctid=".$row['marriedto']."";
//$result2 = db_query($sql2) or die(db_error(LINK));
//$row2 = db_fetch_assoc($result2);
output("<tr class='" . ($i % 2 ? "trlight" : "trdark") . "'><td>`&$row[female_name]`0</td><td>`) und `0</td><td>`&", true);
output("$row[male_name]`0</td></tr>", true);
}
output("</table>", true);
} else {
$sql = "SELECT acctid,name,dragonkills AS data1,level AS data2,' ' AS data3, IF(dragonage,dragonage,'Unknown') AS data4, ' ' AS data5, IF(bestdragonage,bestdragonage,'Unknown') AS data6 FROM accounts WHERE dragonkills>0 AND locked=0 ORDER BY dragonkills $order,level $order,experience $order, acctid $order LIMIT $limit";
$adverb = "meisten";
if ($subop == "least") {
$adverb = "wenigsten";
}
$title = "Helden mit den $adverb Drachenkills";
$headers = array("Kills", "Level", " ", "Tage", " ", "Bestzeit");
$none = "Es gibt noch keine Helden in diesem Land";
display_table($title, $sql, $none, false, $headers, false);
}
page_footer();