-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsubscriptions.php
130 lines (119 loc) · 5.03 KB
/
subscriptions.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
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
<?php
session_start();
include('config.php');
$langrow = $defaultLang;
include('lang.php');
if ($useSQL == true) {
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$stmt = $conn->prepare("SELECT * FROM login WHERE username = ?");
$stmt->bind_param("s", $_SESSION['logged_in_user']);
$stmt->execute();
$result = $stmt->get_result();
while ($row = $result->fetch_assoc())
{
$pwrow = $row['password'];
$customthemeplayerrow = $row['customtheme_player_url'];
}
if ($_SESSION['hashed_pass'] == $pwrow) {
} else {
session_destroy();
}
} else {
session_destroy();
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="apple-mobile-web-app-title" content="Liberatube">
<link rel="apple-touch-icon" href="favicon.ico">
<link rel="stylesheet" href="/styles/-w3.css">
<link rel="stylesheet" href="/styles/-bootstrap.min.css">
<?php
$dbsenduser = $_SESSION['logged_in_user'];
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if (isset($_SESSION['logged_in_user']))
{
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$stmt = $conn->prepare("SELECT * FROM login WHERE username = ?");
$stmt->bind_param("s", $_SESSION['logged_in_user']);
$stmt->execute();
$result = $stmt->get_result();
$numrows = $result->num_rows;
while ($row = $result->fetch_assoc())
{
$themerow = $row['theme'];
$langrow = $row['lang'];
}
$numrows = $result->num_rows;
}
if(strcmp($themerow, 'blue') == 0) {
echo '<link rel="stylesheet" href="../styles/playerblue.css">';
} elseif(strcmp($themerow, 'ultra-dark') == 0) {
echo '<link rel="stylesheet" href="../styles/playerultra-dark.css">';
} elseif ($themerow == "custom") {
echo '<link rel="stylesheet" href="'.$customthemeplayerrow.'">';
} else {
echo '<link rel="stylesheet" href="../styles/player'.$defaultTheme.'.css">';
}
?>
<title>Liberatube · <?php echo $translations[$langrow]['subscriptions']; ?></title>
<body>
<div class="w3-sidebar w3-bar-block w3-collapse w3-card sidebar" style="width:55px;" id="mySidebar">
<button class="w3-bar-item w3-button w3-large w3-hide-large" onclick="w3_close()">×</button>
<a href="/" class="w3-bar-item sidebarbtn awhitesidebar"><span class="material-symbols-outlined">home</span><span class="tooltiptext"><?php echo $translations[$langrow]['home']; ?></span></a>
<a href="/history.php" class="w3-bar-item sidebarbtn awhitesidebar"><span class="material-symbols-outlined">history</span><span class="tooltiptext"><?php echo $translations[$langrow]['watch_history']; ?></span></a>
<a href="/playlist/playlists.php" class="w3-bar-item sidebarbtn awhitesidebar"><span class="material-symbols-outlined">list_alt</span><span class="tooltiptext"><?php echo $translations[$langrow]['playlists']; ?></span></a>
<a href="/subscriptions.php" class="w3-bar-item sidebarbtn awhitesidebar sidebarbtn-selected"><span class="material-symbols-outlined">subscriptions</span><span class="tooltiptext"><?php echo $translations[$langrow]['subscriptions']; ?></span></a>
<a href="/settings.php" class="w3-bar-item sidebarbtn awhitesidebar"><span class="material-symbols-outlined">settings</span><span class="tooltiptext"><?php echo $translations[$langrow]['settings']; ?></span></a>
</div>
<div class="w3-main" style="margin-left:55px">
<div class="w3-tssseal">
<button class="w3-button w3-darkgrey w3-xlarge w3-hide-large" onclick="w3_open()">☰</button>
<div class="w3-container">
<div class="topbar">
<div class="topbarelements topbarelements-center">
<h3 class="title-top topbarelements"><?php echo $translations[$langrow]['subscriptions']; ?></h3>
</div>
<div class="topbarelements topbarelements-right">
<h4> <?php echo $_SESSION['logged_in_user']; ?>
<?php if(isset($_SESSION['logged_in_user']))
{
echo '<a class="button awhite login-item" href="/auth/logout.php"><span class="material-symbols-outlined login-item-icon">logout</span><h5 class="login-item-text">'.$translations[$langrow]['logout'].'</h5></a>';
}
else
{
echo '<a class="button awhite login-item" href="/auth/login.html"><span class="material-symbols-outlined login-item-icon">login</span><h5 class="login-item-text">'.$translations[$langrow]['login-signup'].'</h5></a>';
}
?>
</div>
</div>
</div>
<script src="/scripts/sidebar.js"></script>
<div class="tenborder">
<?php
if(isset($_SESSION['logged_in_user'])) {
echo '<center><h4>'.$translations[$langrow]['this_is_dev'].'</h4></center>';
} else {
echo '<center><h4>You are not logged in.</h4></center>';
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>