-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathpplumayknow.inc.php
More file actions
85 lines (61 loc) · 2.59 KB
/
pplumayknow.inc.php
File metadata and controls
85 lines (61 loc) · 2.59 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
85
<?php
//gettting user gender
$get_user_gender = mysql_query("SELECT * FROM users WHERE username='$user'");
$gender_user_row = mysql_fetch_assoc($get_user_gender);
$user_gender_value = $gender_user_row['gender'];
if($user_gender_value == 1) {
$get_ppl_info = mysql_query("SELECT * FROM users WHERE username!='$user' AND gender='1' AND activated='1' AND blocked_user='0' ORDER BY RAND() ");
//declear variable
$getuserNum= '0';
if($get_ppl_info === FALSE) {
die(mysql_error()); // TODO: better error handling
}
while ($row_user = mysql_fetch_assoc($get_ppl_info)) {
$user_name= $row_user['username'];
//if follow
$if_user_to_follow = mysql_query("SELECT * FROM follow WHERE (user_from='$user' AND user_to='$user_name')");
$count_user_to_follow = mysql_num_rows($if_user_to_follow);
if ($count_user_to_follow == 0) {
$profile_pic_db= $row_user['profile_pic'];
$user_name_f = $row_user['first_name'];
//check for propic delete
$pro_changed = mysql_query("SELECT * FROM posts WHERE added_by='$user_name' AND (discription='changed his profile picture.' OR discription='changed her profile picture.') ORDER BY id DESC LIMIT 1");
$get_pro_changed = mysql_fetch_assoc($pro_changed);
$pro_num = mysql_num_rows($pro_changed);
if ($pro_num == 0) {
$profile_pic = "img/default_propic.png";
}else {
$pro_changed_db = $get_pro_changed['photos'];
if ($pro_changed_db != $profile_pic_db) {
$profile_pic = "/img/default_propic.png";
}else {
$profile_pic = "./userdata/profile_pics/".$profile_pic_db;
}
}
echo "
<form method='POST' action=''>
<div style='display: flex; padding: 8px 0;'> ";
echo "<div>
<img src='$profile_pic' style= 'border-radius: 4px' border: 1px solid #ddd; title=\"$user_name_f\" height='70' width='65' />
</div>";
echo "<div style='margin-left: 10px;'><b><a href='profile.php?u=$user_name' style='text-decoration: none; font-size: 14px; color: #0B810B;' title=\"Go to $user_name_f's Profile\" class='posted_by'>$user_name_f</a></b> <br><br>
<b><a href='profile.php?u=$user_name' style='text-decoration: none; margin: 0px;' class='frndPokMsg' title='View Full Profile' >View Profile</a></b>
</div>";
echo "
</div>
</form>
";
$getuserNum++;
if ($getuserNum == 3){
break;
}
}
//follow request system
if (@($_POST[''.$user_name.''])) {
header("location: profile.php?u=".$user_name."");
}
}
}else if($user_gender_value == 2) {
$get_user = mysql_query("SELECT * FROM users WHERE gender='2'");
}
?>