-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommunity_members.php
153 lines (100 loc) · 2.58 KB
/
community_members.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php
require("helper.php");
session_start();
$messageModal=['show'=>FALSE,'title'=>'...','body'=>'...'];
// LoginCheck();
$community_tag_name="";
$community_name="";
$communiy_id="";
?>
<?php
if(isset($_GET['c'])){
$community_tag_name=$_GET['c'];
}else{
// redirect(getHost());
}
$community_obj=fetch_data("select * from community where tag_name='$community_tag_name'");
//if there is no community
if(count($community_obj)==0){
redirect(getHost());
}
$community_name=$community_obj[0]['community_name'];
$communiy_id=$community_obj[0]['id'];
$is_connected_user=False;
// check if the user login or not
if(isset($_SESSION['uid'])){
// if user allreaday joined to this community
$res=fetch_data('SELECT user_id from community_users where community_id='.$communiy_id.' and user_id='.$_SESSION['uid']);
if(count($res)!=0){
$is_connected_user=True;
}
}
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./asset/community.css">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<title><?=$community_name?></title>
<style>
.vote_btns {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: space-evenly;
align-content: center;
align-items: center;
cursor: pointer;
border-left: 10px solid;
border-right: 0.5px solid darkslategray;
}
.vote_btns.up {}
.vote_btns.down {}
.post-img {
margin-top: 21px;
}
.community-title {
display: flex;
flex-wrap: nowrap;
align-items: center;
position: relative;
top: -27px;
left: 12px;
}
.community-title form {
margin: 10px;
}
.logo-pic {
width: 80px;
height: 80px;
border-radius: 51px;
margin-right: 19px;
}
.community-name {
font-weight: 400;
text-shadow: -1px 1px 1px black;
}
</style>
</head>
<body>
<div class="container">
<div >
<?php
$result=fetch_data("select username from user join community_users ON user.id= community_users.user_id where community_users.community_id='$communiy_id';");
echo " Commmunity Population List: ";
for($i=0; $i<count( $result);$i++)
{
?>
<div> <?=$result[$i]['username'];?> </div>
<?php
}
?>
</div>
</div>
</body>
</html>