-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewpost.php
More file actions
84 lines (74 loc) · 1.91 KB
/
viewpost.php
File metadata and controls
84 lines (74 loc) · 1.91 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
80
81
82
83
84
<?php
include('header.php');
if (isset($_GET['post_unique_id'])) {
$post_unique_id=$_GET['post_unique_id'];
}else{
$post_unique_id="";
}
?>
<div class="container-fluid mb-5" id="mySite">
<div class="row p-2">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-12">
<div class="row justify-content-center">
<div class="col-lg-6">
<div class="row">
<div class="col-lg-12">
<?php
$sqll=mysqli_query($con,"SELECT * FROM posts,users where posts.user_unique_id=users.unique_id and posts.post_unique_id='$post_unique_id' order by posts.id desc");
if ($sqll) {
if (mysqli_num_rows($sqll) >0) {
while ($post=mysqli_fetch_array($sqll)) {
$post_unique_id=$post['post_unique_id'];
$user_to_follow=$post['unique_id'];
?>
<?php include"posts.php"?>
<?php
}
}else{
?>
<div class="row mt-4">
<div class="col-lg-12 text-center">
<h3 class="">No posts yet</h3>
</div>
</div>
<?php
}
}else{
echo"<div class='alert error'>".$con->error."</div>";
}
?> </div>
<div class="col-lg-12 mt-3">
More posts related to this
<hr>
<?php
$sqll=mysqli_query($con,"SELECT * FROM posts,users where posts.user_unique_id=users.unique_id and posts.user_unique_id='$user_to_follow' and posts.post_unique_id!='$post_unique_id' order by posts.id desc");
if ($sqll) {
if (mysqli_num_rows($sqll) >0) {
while ($post=mysqli_fetch_array($sqll)) {
$post_unique_id=$post['post_unique_id'];
$user_to_follow=$post['unique_id'];
?>
<?php include"posts.php"?>
<?php
}
}else{
?>
<?php
}
}else{
echo"<div class='alert error'>".$con->error."</div>";
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>