1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
|
} elseif ($action==\"highscore\") {
$result=$db->query(\"SELECT * FROM bb\".$n.\"_mastermind_rater WHERE (winbit='1' AND looser='0') ORDER BY level,description,versuche ASC\");
while ($row1 = $db->fetch_array($result)) {
$dummy=$db->query_first(\"SELECT username FROM bb\".$n.\"_users WHERE userid='$row1[userid]'\");
eval (\"\$highscorebit .= \\"\".$tpl->get(\"mastermind_games\").\"\\";\");
}
eval (\"\$mastermindbit= \\"\".$tpl->get(\"mastermind_highscore\").\"\\";\");
} elseif ($action==\"hightop\") {
$db->query(\"DROP TABLE IF EXISTS bb\".$n.\"_mastermind_highscore\");
$db->query(\"CREATE TABLE bb\".$n.\"_mastermind_highscore (
`no` int(15) NOT NULL auto_increment,
`userid` int(11) NOT NULL default '0',
`username` varchar(50) NOT NULL default '0',
`win` int(11) NOT NULL default '0',
`loose` int(11) NOT NULL default '0',
`kohle` int(11) NOT NULL default '0',
`tries` int(11) NOT NULL default '0',
`make` int(11) NOT NULL default '0',
PRIMARY KEY (`no`)
) TYPE=MyISAM;\");
/* ##### hier wird die Highscore-Tabelle erstellt ##### */
$user=0;$change=0;
$result=$db->query(\"SELECT * FROM bb\".$n.\"_mastermind_rater WHERE winbit='1' ORDER BY userid ASC\");
while ($row = $db->fetch_array($result)) {
$uid=$row['userid'];
if ($user <> $uid) {
$user=$uid;$change=1;
}
if ($change==1) {
$change=0;
$db->query(\"INSERT INTO bb\".$n.\"_mastermind_highscore SET userid='$uid'\");
}
}
/* ##### und hier wird sie erweitert ##### */
$loose=0;$win=0;$kohle=0;$tries=0;$make=0;
$result=$db->query(\"SELECT * FROM bb\".$n.\"_mastermind_highscore\");
while ($row = $db->fetch_array($result)) {
$uid=$row['userid'];
$dummy=$db->query_first(\"SELECT username FROM bb\".$n.\"_users WHERE userid='$uid'\");
$uname=$dummy['username'];
$snoopy=$db->query(\"SELECT * FROM bb\".$n.\"_mastermind_rater WHERE userid='$uid'\");
while ($row1 = $db->fetch_array($snoopy)) {
$loose=$loose+$row1['looser'];
$win=$win+$row1['winbit'];
$kohle=$kohle+$row1['jackpott'];
$tries=$tries+$row1['versuche'];
}
$dummy=$db->query(\"SELECT * FROM bb\".$n.\"_mastermind_games WHERE userid='$uid'\");
while ($row2 = $db->fetch_array($dummy)) {
$make++;
}
$db->query(\"UPDATE bb\".$n.\"_mastermind_highscore SET username='$uname', win='$win', loose='$loose', kohle='$kohle', tries='$tries', make='$make' WHERE userid='$uid'\");
$loose=0;$win=0;$kohle=0;$tries=0;$make=0;
}
/* ##### und hier wird sie ausgegeben ##### */
$result=$db->query(\"SELECT * FROM bb\".$n.\"_mastermind_highscore ORDER BY kohle DESC,win DESC,tries DESC\");
while ($row = $db->fetch_array($result)) {
eval (\"\$highscorebit .= \\"\".$tpl->get(\"mastermind_hightopbit\").\"\\";\");
}
eval (\"\$mastermindbit= \\"\".$tpl->get(\"mastermind_hightop\").\"\\";\");
}
$db->free_result($result);
eval(\"\$tpl->output(\\"\".$tpl->get(\"mastermind\").\"\\");\");exit();
} else {
eval(\"error(\\"\".$tpl->get(\"mastermind_gast\").\"\\");\");
}
function getit($dummy){
global $db,$n;
$res=$db->query_first(\"select \".$dummy.\" from bb\".$n.\"_mastermind_config where guthaben='1'\");
return $res['0'];
}
?> |