-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphotos.php
More file actions
80 lines (77 loc) · 3.51 KB
/
photos.php
File metadata and controls
80 lines (77 loc) · 3.51 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
include 'dbconn.php';
include 'magic.php';
if (session_status() == PHP_SESSION_NONE) {
session_start();
if($_SESSION['fname']==''){header('Location:login.php');}
}
$user_id = $_SESSION['user_id'];
?>
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="simple-grid.css">
<link rel="stylesheet" type="text/css" href="main.css">
<script src="jquery-3.1.0.min.js"></script>
</head>
<body>
<nav class="row">
<span class="col-1-sm"></span>
<span class="col-2-sm"><a href="index.php" style="text-decoration:none;">F.R.I.E.N.D.S</a></span>
<span class="col-6-sm"></span>
<span id="navbarname" class="col-1-sm"><?php echo $_SESSION['fname']?></span>
<span class="col-1-sm">
<a href="mailto:fbtests.reportbug@gmail.com?Subject=Bug%20Report%20on%20FRIENDS">
<img src="photos/contribute_bug.png" title="Report Bug" style="max-height:1em;width:auto;">
</a>
</span>
<span id="logoutbtn" class="col-1-sm"><a href="logout.php" tabindex="-1">!</a></span>
</nav>
<div id="sidenav" class="sidenav">
<span class=""><a href="index.php">Feed</a></span>
<span class=""><a href="posts.php?v_id=<?= $user_id ?>">Posts</a></span>
<span class=""><a href="photos.php">Photos</a></span>
<span class=""><a href="events.php">Events</a></span>
<span class=""><a href="friends.php">Friends
<?php
connect();
$sqlcount = 'SELECT COUNT(USER_ID) AS P_F FROM USERS WHERE
USER_ID IN (SELECT USER_ID1 AS U_ID FROM FRIENDS WHERE (USER_ID2='.$user_id.') AND ACCEPT_DATE IS NULL)';
$result = $conn->query($sqlcount);
if ($result->num_rows > 0) {
while($row_cursor = $result->fetch_assoc()) {
$p_f = $row_cursor['P_F'];
if($p_f==0){
echo '';
}
else{
echo '<span class="badge">'.$row_cursor['P_F'].'</span>';
}
}
}
disconnect();
?>
</a>
</span>
<span class="shouts-link"><a href="shouts.php">Shouts</a></span>
<span class="report-bug"><a href="mailto:fbtests.reportbug@gmail.com?Subject=Bug%20Report%20on%20FRIENDS">Report Bug</a>
</div>
<div class="middle-content">
<div id="photos-div" class="row">
<?php
connect();
$sqlP = "SELECT PHOTO_ID,LINK FROM PHOTOS WHERE USER_ID = '".$user_id."'";
$resultP = $conn->query($sqlP);
if ($resultP->num_rows > 0) {
while($row_cursorP = $resultP->fetch_assoc()) { ?>
<img class="photo-display box" src="<?= 'photos/'.$row_cursorP['LINK'] ?>">
<?php
}
} disconnect();?>
</div>
</div>
</body>
</html>