-
Notifications
You must be signed in to change notification settings - Fork 5
/
menu.php
98 lines (86 loc) · 3.49 KB
/
menu.php
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
// All pages that include the menu should have started the session is they want to use logged in information
if (isset($maintenanceMode) && $maintenanceMode <> true) {
/*
Menu for teamladder
*/
if (isset($CFG_teamladder) && $CFG_teamladder == true) {
?>
<div id="nav">
<ul>
<?php if (isset($_SESSION['username'])) { ?>
<li><a href="team_create.php">CreateTeam</a></li>
<?php } ?>
<li><a href="ladder.php">Ladder</a></li>
<li><a href="tournament.php">Tournaments</a></li>
<li><a href="team_report.php">Report</a></li>
<li><a href="team_profile.php">Profile</a></li>
</ul>
<?php
//next lines create an additional menu with the only purpose of accessing different ladders
//checks if multiladder is enabled and then reads the $G_CFG_enabled_ladder_list array and will create for each entry a link plus $_GET Parameter
//
if (isset($G_CFG_multiladder) && $G_CFG_multiladder == true) {
?>
<br></br>
<ul style="font-size: x-small;">
<li><b>Ladderselection:</b></li>
<?php
foreach ($G_CFG_enabled_ladder_list as $key => $value) {
echo "<li><a href=\"index.php?ladder=" . $value . "\">" . $value . "</a></li>";
}
?>
</ul>
<?php } ?>
</div> <?php
} else {
/*
Menu for normal ladder
*/
?>
<div id="nav">
<ul>
<?php if (!isset($_SESSION['username'])) { ?>
<li><a href="join.php">Join</a></li>
<?php } ?>
<li><a href="report.php">Report</a></li>
<li><a href="ladder.php">Ladder</a></li>
<li><a href="gadder.php">Classes</a></li>
<li><a href="players.php">Players</a></li>
<li><a href="gamehistory.php">Game History</a></li>
<?php if (isset($_SESSION['username'])) { ?>
<li><a href="ladder.php?personalladder=<?php echo urlencode($_SESSION['username']) ?>">My Ladder</a>
</li>
<?php } ?>
<?php if (isset($_SESSION['username'])) {
echo "<li><a href=\"profile.php?name=" . $_SESSION['username'] . "\">" . $_SESSION['username'] . "</a></li>";
}
?>
<li><a href="faq.php">FAQ</a></li>
</ul>
<?php
//next lines create an additional menu with the only purpose of accessing different ladders
//checks if multiladder is enabled and then reads the $G_CFG_enabled_ladder_list array and will create for each entry a link plus $_GET Parameter
//
if (isset($G_CFG_multiladder) && $G_CFG_multiladder == true) {
?>
<br></br>
<ul style="font-size: x-small;">
<li><b>Ladderselection:</b></li>
<?php
foreach ($G_CFG_enabled_ladder_list as $key => $value) {
echo "<li><a href=\"index.php?ladder=" . $value . "\">" . $value . "</a></li>";
}
?>
</ul>
<?php
}
?>
</div>
<?php
}
} else {
?>
<div id="nav"></div>
<?php
}