-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevelopQuestionFurther.php
108 lines (97 loc) · 3.81 KB
/
developQuestionFurther.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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
/*if(isset($_SESSION['id'])){
echo '<a href="userprofile.php">Back to profile page</a>';
}
else{
echo '<a href="index.php">Back to home page</a>';
}*/
//session_start();
ob_start();
include 'top.php';
$b=ob_get_contents();
ob_end_clean();
$title = "Develop Question Further";
$buffer = preg_replace('/(<title>)(.*?)(<\/title>)/i', '$1' . $title . '$3', $b);
echo $buffer;
?>
<img src="logo/m_gold.png" class="develop-logo centering">
<p class="develop-text">We are working on a memeMaker with amazing features. If you have got ideas that you would like to be included in this memeMaker, you can mail us at support@meagl.com.</p>
<?php
if(!isset($_SESSION['id'])){
?>
<p class="develop-sign-in">Not signed in yet? <a href="signup.php">Sign in</a> now!</p>
<?php
}
?>
<div class="small-notifications-column">
<?php
if(isset($_SESSION['id']))
{
$userId=mysqli_real_escape_string($conn,$_SESSION['id']);
$sql="SELECT * FROM notifications_table WHERE receiverId='$userId' ORDER BY id DESC";
$result=mysqli_query($conn,$sql);
$areThereNotifications=false;
$notifications_counter=0;
echo '<div class="small-notifications-body">';
while($row=mysqli_fetch_assoc($result)){
$areThereNotifications=true;
$notification=$row['notification'];
$notificationId=mysqli_real_escape_string($conn,$row['id']);
$datetime=$row['datetime'];
$nL=$row['notificationLink'];
$senderId=$row['senderId'];
$sql1="SELECT profilePictureLocation FROM memberstable WHERE id='$senderId'";
$result1=mysqli_query($conn,$sql1);
$row1=mysqli_fetch_assoc($result1);
$ppL=$row1['profilePictureLocation'];
if($ppL=='')
{
//this means its a group ka notification
if(preg_match_all('/\d+/', $nL, $numbers))
{
$groupId = end($numbers[0]);
}
$sql10="SELECT groupPicLocation FROM groups_table WHERE id='$groupId'";
$result10=mysqli_query($conn,$sql10);
$row10=mysqli_fetch_assoc($result10);
$ppL=$row10['groupPicLocation'];
}
$viewingStatus=$row['viewingStatus'];
if($viewingStatus==0)
{
$notifications_counter+=1;
?>
<a href="<?php echo htmlentities($nL); ?>" class="notif-link" id="notification<?php echo htmlentities($notificationId); ?>">
<div class="notif">
<img src="<?php echo htmlentities($ppL) ?>" class="small-notif-dp">
<p class="small-notif-text"><?php echo $notification; ?></p>
</div>
</a>
<?php
}
else
{
?>
<a href="<?php echo htmlentities($nL); ?>" class="notif-link" id="notification<?php echo htmlentities($notificationId); ?>">
<div class="notif" style="background-color:#EAEAEA">
<img src="<?php echo htmlentities($ppL) ?>" class="small-notif-dp">
<p class="small-notif-text"><?php echo $notification; ?></p>
</div>
</a>
<?php
}
}
if($areThereNotifications==false){
echo '<p>No notifications yet!</p>';
}else{
?>
<script>thereAreNotifications(<?php echo $notifications_counter; ?>);</script>
<?php
}
echo "</div>";
}
?>
</div>
</div>
</body>
</html>