forked from Ahe4d/spacemy.xyz
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
59 lines (55 loc) · 2.54 KB
/
Copy pathheader.php
File metadata and controls
59 lines (55 loc) · 2.54 KB
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
<?php
if(isset($_SESSION['user'])) {
$stmt = $conn->prepare("UPDATE users SET lastactive = NOW() WHERE username = ?");
$stmt->bind_param("s", $_SESSION['user']);
$stmt->execute();
$stmt->close();
}
?>
<div class="header">
<div class="headerTop">
<a href="/"><b><?php echo SITE_TITLE; ?></b></a>
<form action="/search.php" method="get" class="search">
<input placeholder="Search" type="text" name="query">
<select name="queryfor">
<option value="Users">Users</option>
<option value="Groups">Groups</option>
<option value="Blogs">Blogs</option>
</select>
<input type="submit" value="Search">
</form>
</div>
<div class="headerBottom">
<small>
<?php
if(isset($_SESSION['user'])) {
echo '<a href="/">Your Account</a> • ';
} else {
echo '<a href="/register.php">Register</a> • <a href="/login.php">Login</a> • ';
}
?>
<a href="/groups">Groups</a> • <a href="/blogs">Blogs</a> • <a href="/jukebox.php">Jukebox</a> • <a href="/random.php">Random</a> • <a href="/users.php">Users</a> <?php if(VIDEOS_MODULE == true) { echo "• <a href='/videos'>Videos</a>"; }?>
</small>
<small><span style="float:right">
<?php
if(isset($_SESSION['user']))
{
$stmt = $conn->prepare("SELECT * FROM `friends` WHERE reciever = ? AND status='PENDING'");
$stmt->bind_param("s", $_SESSION['user']);
$stmt->execute();
$result = $stmt->get_result();
$pendingFriendRequests = 0;
while($row = $result->fetch_assoc()) { $pendingFriendRequests++; }
if($pendingFriendRequests)
{
echo "<span style='color: yellow; text-decoration: none;'><a href='/friends.php'>".$pendingFriendRequests." pending friend request(s)</a></span> - ";
}
echo "<a href='/friends.php'>Friends</a> - <a href='/manage.php'>Manage Account</a> - <a href='/logout.php'>Log out</a> - " . $_SESSION['user'] . "";
} else { echo "Not logged in. <a href='/login.php'>Log in</a>"; }
?>
</span></small>
</div>
</div>
<div style="border: 1px solid black;text-align: center;">
https://discord.gg/APPBCdx
</div>