-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfollowlist.php
executable file
·60 lines (54 loc) · 1.21 KB
/
followlist.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
<?php
require 'assets/backend/connect.php';
require 'assets/backend/core.php';
$user_id=$_SESSION["user_id"];
$u_id=$_GET['id'];
$query1="SELECT * FROM login WHERE id='$u_id'";
$query1_run=mysqli_query($con,$query1);
$query1_array=mysqli_fetch_assoc($query1_run);
if(isset($_SESSION['user_id']) && !empty($_SESSION['user_id']))
{
$follow=$query1_array['follow'];
$x= explode(',',$follow);
foreach($x as $x_a)
{
$query_2="SELECT * FROM login WHERE id='$x_a'";
$query2_run=mysqli_query($con,$query_2);
while($query_array3=mysqli_fetch_assoc($query2_run))
{
if(file_exists('images/users/'.$x_a.'.jpg'))
{
echo $x_a;
}
else
{
echo 'default'.$x_a;
}
echo '~'.$query_array3['firstname'].' '.$query_array3['surname'].'~';
$checklist=$query_array3['follow'];
$y= explode(',',$checklist);
$a=0;
foreach($y as $y_a)
{
if($y_a==$user_id)
{
$a=1;
}
}
if(@$a!=1)
{
if($user_id!=$x_a)
{
echo 'Follow/';
}
else {
echo '/';
}
}
else {
echo 'Following/';
}
}
}
}
?>