forked from Talishar/Talishar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProfilePage.php
90 lines (77 loc) · 3.2 KB
/
ProfilePage.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
<?php
require "MenuBar.php";
if (!isset($_SESSION['userid'])) {
header('Location: ./MainMenu.php');
die();
}
include_once "CardDictionary.php";
include_once "./Libraries/UILibraries2.php";
include_once "./APIKeys/APIKeys.php";
if (isset($_SESSION['userid'])) {
$badges = LoadBadges($_SESSION['userid']);
echo ("<div class='ContentWindow' style='position:relative; width:50%; left:20px; top:20px; height:200px;'>");
echo ("<h1>Your Badges</h1>");
for ($i = 0; $i < count($badges); $i += 7) {
$bottomText = str_replace("{0}", $badges[$i + 2], $badges[$i + 4]);
$fullText = $badges[$i + 3] . "<br><br>" . $bottomText;
if ($badges[$i + 6] != "") echo ("<a href='" . $badges[$i + 6] . "'>");
echo ("<img style='margin:3px; width:120px; height:120px; object-fit: cover;' src='" . $badges[$i + 5] . "'></img>");
if ($badges[$i + 6] != "") echo ("</a>");
}
echo ("</div>");
}
if (isset($_SESSION["isPatron"])) {
echo ("<div class='ContentWindow' style='width: 50%; left:20px; height: calc(90% - 220px); bottom:20px; overflow-y: scroll;'>");
echo ("<h1>Your Record</h1>");
$forIndividual = true;
include_once "zzGameStats.php";
echo ("</div>");
}
?>
<script src="./jsInclude.js"></script>
<div id="cardDetail" style="z-index:100000; display:none; position:fixed;"></div>
<div class='ContentWindow' style='left:60%; right:20px; top:60px; height:90%;'>
<h2>Welcome <?php echo $_SESSION['useruid'] ?>!</h2>
<?php
DisplayPatreon();
echo ("<h1>Favorite Decks</h1>");
$favoriteDecks = LoadFavoriteDecks($_SESSION["userid"]);
if (count($favoriteDecks) > 0) {
echo ("<table>");
echo ("<tr><td>Hero</td><td>Deck Name</td><td>Delete</td></tr>");
for ($i = 0; $i < count($favoriteDecks); $i += 4) {
echo ("<tr>");
echo ("<td>" . CardLink($favoriteDecks[$i + 2], $favoriteDecks[$i + 2], true) . "</td>");
echo ("<td>" . $favoriteDecks[$i + 1] . "</td>");
echo ("<td><a style='text-underline-offset:5px;' href='./MenuFiles/DeleteDeck.php?decklink=" . $favoriteDecks[$i] . "'>Delete</a></td>");
echo ("</tr>");
}
echo ("</table>");
}
function DisplayPatreon()
{
global $patreonClientID, $patreonClientSecret;
$client_id = $patreonClientID;
$client_secret = $patreonClientSecret;
//$redirect_uri = "https://www.talishar.net/game/PatreonLogin.php";
$redirect_uri = "https://legacy.talishar.net/game/PatreonLogin.php";
$href = 'https://www.patreon.com/oauth2/authorize?response_type=code&client_id=' . $client_id . '&redirect_uri=' . urlencode($redirect_uri);
$state = array();
$state['final_page'] = 'http://fleshandbloodonline.com/FaBOnline/MainMenu.php';
$state_parameters = '&state=' . urlencode(base64_encode(json_encode($state)));
$href .= $state_parameters;
$scope_parameters = '&scope=identity%20identity.memberships';
$href .= $scope_parameters;
if (!isset($_SESSION["patreonAuthenticated"])) {
echo ("<BR>");
echo ("<BR>");
echo '<a class="containerPatreon" href="' . $href . '">';
echo ("<img class='imgPatreon' src='./Assets/patreon-php-master/assets/images/login_with_patreon.png' alt='Login via Patreon'>");
echo '</a>';
}
}
?>
</div>
<?php
require "Disclaimer.php";
?>