-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathReplays.php
67 lines (58 loc) · 1.68 KB
/
Replays.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
<?php
include "HostFiles/Redirector.php";
include_once 'MenuBar.php';
include_once 'APIKeys/APIKeys.php';
$isPatron = $_SESSION["isPatron"] ?? false;
if(!$isPatron)
{
echo("Replay functionality is only available to patrons.");
exit;
}
$userId = "";
if(isset($_SESSION["userid"])) $userId = $_SESSION["userid"];
if($userId == "")
{
echo("You must be logged in to use this feature.");
exit;
}
$path = "./Replays/" . $userId . "/";
if(!file_exists($path))
{
echo("You have no replays. Play some games and save replays to use this feature!");
exit;
}
?>
<style>
body {
background-image: url('Images/Metrix.jpg');
background-position: top center;
background-repeat: no-repeat;
background-size: cover;
overflow: hidden;
}
</style>
<section class="draft-form">
<h2>Replays</h2>
<?php
if ($handle = opendir($path)) {
while (false !== ($folder = readdir($handle))) {
if ('.' === $folder) continue;
if ('..' === $folder) continue;
if ($folder == "counter.txt") continue;
$gameToken = $folder;
$folder = $path . $folder . "/";
//echo("<a href='./CreateReplayGame.php?replayNumber=$gameToken'>Replay #" . $gameToken . "</a><BR>");
echo('<div class="draft-form-form">');
//echo("<a href='./CreateReplayGame.php?replayNumber=$gameToken'>Replay #" . $gameToken . "</a><BR>");
echo('<form action="CreateReplayGame.php" method="get">');
echo("<input type='hidden' id='replayNumber' name='replayNumber' value='$gameToken'>");
echo("<input type='submit' style='font-size:20px;' value='Replay #$gameToken'>");
echo('</form>');
echo('</div>');
}
}
?>
</section>
<?php
include_once 'Disclaimer.php'
?>