This repository has been archived by the owner on Oct 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
176 lines (146 loc) · 8.33 KB
/
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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
session_start();
require_once("config.php");
require_once("functions.php");
if($rPage=="logout") {
session_destroy();
session_unset();
setcookie("loggedincookie", "", time() - 3600);
header("location: ".$url."home/");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Saintly2k">
<meta name="description" content="<?= $config["description"] ?>">
<meta name="keywords" content="<?= $config["tags"] ?>">
<meta property="og:site_name" content="<?= $config["name"] ?>">
<meta property="og:title" content="<?= $pPage." | ".$name ?>">
<meta property="og:image" content="<?= $url."favicon.ico" ?>">
<title><?= $pPage." | ".$name ?></title>
<link href="<?= $url ?>scripts/bootstrap/css/bootstrap.<?= $config["theme"] ?>.css" rel="stylesheet">
<link href="<?= $url ?>scripts/bootstrap/css/bootstrap-select.min.css" rel="stylesheet">
<link href="<?= $url ?>scripts/bootstrap/css/bootstrap-checkbox.css" rel="stylesheet">
<link href="<?= $url ?>scripts/theme.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?= $url ?>"><span class="glyphicon glyphicon-music"></span> <?= $name ?></a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li <?php if($rPage=="all") { echo 'class="active"'; } ?></l><a href="<?= $url ?>all/1"><span class="glyphicon glyphicon-home"></span> All <span class="sr-only">(current)</span></a></li>
<li <?php if($rPage=="new") { echo 'class="active"'; } ?>><a href="<?= $url ?>new/"><span class="glyphicon glyphicon-open"></span> New</a></li>
<!-- <li <?php if($rPage=="search") { echo 'class="active"'; } ?>><a href="<?= $url ?>search/"><span class="glyphicon glyphicon-search"></span> Search</a> -->
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<form class="navbar-form navbar-left" method="post" name="quicsearch" action="">
<div class="form-group">
<input type="text" class="form-control" name="disc_name" placeholder="What Disc in the shelf?">
</div>
<button type="submit" class="btn btn-default" name="quicsearch">Search!</button>
</form>
<?php if(empty($_SESSION["username"])) { ?>
<li <?php if($rPage=="login") { echo 'class="active"'; } ?>><a href="<?= $url ?>login/"><span class="glyphicon glyphicon-log-in"></span> Login <span class="sr-only">(current)</span></a></li>
<li <?php if($rPage=="signup") { echo 'class="active"'; } ?>><a href="<?= $url ?>signup/"><span class="glyphicon glyphicon-plus"></span> Signup</a></li>
<?php } else { ?><li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-user"></span> <?= $_SESSION["username"] ?> <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="<?= $url ?>user/favourites/">My Favourites</a></li>
<li><a href="<?= $url ?>user/comments/">My Comments</a></li>
<li><a href="<?= $url ?>user/uploads/">My Uploads</a></li>
<li><a href="<?= $url ?>user/token/">My API Token</a></li>
<li role="separator" class="divider"></li>
<li><a href="<?= $url ?>logout/">Logout</a></li>
</ul>
</li>
<?php } ?>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="container">
<div class="row">
<div class="col-sm-9">
<?php include($rPage.".php"); ?>
</div>
<div class="col-sm-3">
<div class="panel panel-warning">
<div class="panel-heading">
<h3 class="panel-title">Quicksearch</h3>
</div>
<div class="panel-body">
<form class="" method="post" name="quicsearch" action="">
<div class="form-group">
<input type="text" class="form-control" name="disc_name" placeholder="What Disc in the shelf?">
</div>
<button type="submit" class="btn btn-success" style="width:100%" name="quicsearch">Search!</button>
</form>
</div>
</div>
<!--<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Newest Discs</h3>
</div>
<div class="panel-body">
Newest Discs here.
</div>
</div>-->
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">Your Account</h3>
</div>
<div class="panel-body">
<?php if(empty($_SESSION["username"])) { ?>
You aren't logged in. You can't:
<ul>
<li>Add Discs</li>
<li>Edit Discs</li>
<li>Comment</li>
<li>Vote/Like</li>
</ul>
<a href="<?= $url ?>login/">Login</a> or <a href="<?= $url ?>signup/">Signup</a>?
<?php } else { ?>
Welcome, <?= mysqli_real_escape_string($conn, $_SESSION["username"]) ?>!
<ul>
<li><a href="<?= $url ?>user/comments/">My Comments</a></li>
<li><a href="<?= $url ?>user/favourites/">My Favourites</a></li>
<li><a href=" <?= $url ?>user/uploads/">My Uploads</a></li>
<li><a href=" <?= $url ?>user/token/">My API Token</a></li>
</ul>
<a href="<?= $url ?>logout">Logout?</a>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<!-- message_container -->
<div id="message_container" class="display-none"></div>
<!-- /container -->
<footer class="footer">
<p class="text-center text-muted">
Copyright © <?= date("Y") ?> <a href="<?= $url ?>"><?= $config["name"] ?></a> | Powered by <a href="https://github.com/H33Tx/BurningDiscs" target="_blank">BurningDiscs</a> by <a href="https://github.com/saintly2k" target="_blank">saintly2k</a>
</p>
</footer>
<script src="<?= $url ?>scripts/jquery.min.js"></script>
<script src="<?= $url ?>scripts/jquery.touchSwipe.min.js"></script>
<script src="<?= $url ?>scripts/bootstrap/js/bootstrap.min.js"></script>
<script src="<?= $url ?>scripts/bootstrap/js/bootstrap-select.min.js"></script>
</body>
</html>