-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpanel.php
More file actions
140 lines (138 loc) · 4.3 KB
/
panel.php
File metadata and controls
140 lines (138 loc) · 4.3 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php session_start();
require_once("require/basic.php");
require_once("require/secure.php");
require_once("require/rgame.php");
require_once("require/rstun.php");
Secure(false);
if( isset($_GET["reload"]) )
{
reload_self();
}
if( isset($_REQUEST["action"]) )
{
$action = $_REQUEST["action"];
if( $action == "Show Score" )
{
$sql->query("UPDATE `hvz_players` SET `show_score`=1 WHERE `id`='" . ID() . "'");
set_alert("SUCCESS", "Your score is now visible to other players.");
}
elseif($action == "Hide Score")
{
$sql->query("UPDATE `hvz_players` SET `show_score`=0 WHERE `id`='" . ID() . "'");
set_alert("SUCCESS", "Score hidden.");
}
elseif($action == "Set My Score" && IsAdmin())
{
$score = $_REQUEST["score"];
$score = intval($sql->real_escape_string($score));
$sql->query("UPDATE `hvz_players` SET `score`='$score', `bonus_score`='$score' WHERE `id`='" . ID() . "'");
set_alert("SUCCESS", "Score updated.");
}
elseif($action == "Unsubscribe")
{
update_player_sub(ID(), false);
setup_subscription_by_type(Email(), Type(), false);
set_alert("SUCCESS", "Unsubscribed.");
}
elseif($action == "Subscribe")
{
update_player_sub(ID(), true);
setup_subscription_by_type(Email(), Type(), true);
set_alert("SUCCESS", "Subscribed.");
}
}
page_head();?>
<div class="row">
<div class='col-md-12'>
<h2>Welcome, <?php echo First(); ?> <?php echo Last(); ?></h2>
</div>
</div>
<div class="row">
<div class='col-md-3'>
<?php
if( IsAdmin() ) {
?>
<form method="post" action="">
<div class="form-group">
<label>Set Your Score: </label>
<input class="form-control" name="score" value="<?php echo Score(); ?>" />
</div>
<input class="btn btn-default" type="submit" name="action" value="Set My Score" /><br/>
</form>
<?php
}
else
{
echo "<div class='row'>";
echo "<div class='col-md-12'>";
if( is_game_started() )
{
echo "The game is currently <strong>active</strong>.";
}
else
{
$date = date('l F jS \a\t g:iA', strtotime(get_game_start()));
echo "<div>The game has not yet begun. It will start $date</div>";
}
echo "</div></div>";
?>
<?php if( IsPlayer() ) { ?>
<p>To send an e-mail to all players, e-mail <a href="mailto:hvz@csclub.uwaterloo.ca">hvz@csclub.uwaterloo.ca</a>.
<?php } ?>
<?php if( IsZombie() ) { ?>
To send an e-mail to your fellow zombies, e-mail <a href="mailto:hvz-zombies@csclub.uwaterloo.ca">hvz-zombies@csclub.uwaterloo.ca</a>.
<?php } ?>
</p>
<?php if( IsPlayer() || IsSpectator() ) {
$text = "subscribed";
$button = "Unsubscribe";
if( !IsSubscribed() ) {
$text = "unsubscribed";
$button = "Subscribe";
}
?>
<p>You are currently <?php echo $text; ?> from the all players mailing list. <form method="post" action=""><input type="submit" class="btn btn-default" name="action" value="<?php echo $button; ?>" /></form></p>
<?php }
// Inventory visible for humans or spectators
if( IsHuman() || IsSpectator() ) {
echo "<strong>Human Inventory:</strong>";
echo "<p>";
$text = get_inventory();
if(is_null($text) || trim($text) == "") echo "Empty";
else echo nl2br($text);
echo "</p>";
}
echo "<strong>Team:</strong> " . Team() . "<br/>";
if( IsPlayer() )
{
echo "<strong>Player Code:</strong> " . Code() . "<br/>";
echo "<strong>Total Team Score:</strong> " . get_team_score(Type()) . "<br/>";
echo "<strong>My Score:</strong> " . Score() . "<br/>";
if( IsHuman() )
{
echo "<strong>Stuns (Ratified) Against Zombies:</strong> " . get_stuns_from_me(ID()) . "<br/>";
}
elseif( IsZombie() )
{
echo "<strong>Stuns (Ratified) Against Me:</strong> " . get_stuns_on_me(ID()) . "<br/>";
}
if( ShowScore() )
{
?>
Your score is currently <strong>visible</strong> to other players.<br/>
<form method="post" action=""><input type="submit" class="btn btn-default" name="action" value="Hide Score" /></form>
<?php
}
else
{
?>
Your score is currently <strong>hidden</strong> from other players.<br/>
<form method="post" action=""><input type="submit" class="btn btn-default" name="action" value="Show Score" /></form>
<?php
}
}
}
page_foot();
?>
</div>
</div>