-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
43 lines (33 loc) · 924 Bytes
/
index.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
<?php
require_once("common.php");
$subtext = "";
if(!isLoggedIn()) {
$subtext = <<<TEXT
<p>On this platform, you can play and organize warlight ladders.</p>
TEXT;
$subtext .= "<p><a class=\"btn btn-lg btn-primary\" href=\"{$config["loginUrl"]}\" role=\"button\">Join today</a></p>";
}
$openLaddersHtml = renderOpenLadders("Open ladders", 0, 10);
$html = "";
if(isLoggedIn()) {
$myLaddersHtml = renderMyLadders(currentUserID(), "Your ladders", 0, 5);
$myGamesHtml = renderGames(currentUserID(), null, "Your recent games", "You have not played any ladder games yet.", 0, 5);
$html .= <<<HTML
<div class="row">
<div class="col-md-6">
$openLaddersHtml
</div>
<div class="col-md-6">
$myLaddersHtml
</div>
</div>
<div class="row">
<div class="col-md-12">
$myGamesHtml
</div>
</div>
HTML;
} else {
$html .= $openLaddersHtml;
}
page($html, "home", "Warladder.net", "Warlight ladder platform", $subtext);