-
Notifications
You must be signed in to change notification settings - Fork 0
/
location.php
330 lines (239 loc) · 7.65 KB
/
location.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<?php ob_start();
?>
<?php include"sessions.php";
$page="allowed";
?>
<?php
$ss= $_GET[search];
// echo"<p>$look</p>";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title><?php echo "$ss"; ?></title>
<!-- Path to Framework7 Library CSS-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="css/framework7.material.min.css">
<!-- Path to your custom app styles-->
<link rel="stylesheet" href="css/framework7.material.colors.min">
<link rel="stylesheet" href="css/my-app.css">
</head>
<body>
<div class="views">
<div class="view view-main">
<div class="pages navbar-fixed toolbar-fixed">
<div class="page " <?php echo"style='background-color:$backgroundc;'"; ?>>
<div class="navbar" style="background-color:<?php
if($menu){
echo"$menu";
}else{
echo"#0c56ac";
}
?>">
<div class="navbar-inner">
<div class="left"><a href="
<?php
$from_url = $_SERVER['HTTP_REFERER'];
if($from_url){
echo"$from_url";
}else{
echo"home.php";
}
?>
" class="back link icon-only"><i class="icon icon-back"></i></a></div>
<form action='search.php' method='GET'
data-search-in="search.php" class="searchbar " style="background-color:<?php
if($menu){
echo"$menu";
}else{
echo"#0c56ac";
}
?>" >
<div class="searchbar-input">
<input type="search" placeholder="<?php if($ss){
echo"$ss";
}else{
echo"Search";
}
?>" name='search'/><a href="#" class="searchbar-clear"></a>
</div>
</form>
<div class="right"><a href="#" class="link open-panel icon-only"><i class="icon icon-bars"></i></a></div>
</div>
</div>
<?php include"side.php"; ?>
<div class="toolbar tabbar" style="background-color:<?php
if($menu){
echo"$menu";
}else{
echo"#0c56ac";
}
?>">
<div class="toolbar-inner"><a href="#tab1" class="active tab-link">Top</a><a href="searchlate.php?search=<?php echo"$ss"; ?>" class="tab-link">Latest</a>
</div>
</div>
<div class="page-content">
<div class="card">
<div class="card-header">Location</div>
<div class="card-content">
<div class="card-content-inner">
<?php
$sear = $_GET['search'];
if($_GET['search']!=""){ echo "<iframe width='99%' src='http://maps.google.com/maps?q=$sear&t=m&output=embed'></iframe>
";
}?> </div></div>
<div class="card-footer"><?php echo"$ss"; ?></div>
</div>
<?php
$next= $_GET['more'];
$nxt= $_GET['nxt'];
// echo"<p>$look</p>";
?>
<?php
function getTime($t_time){
$pt = time() - $t_time;
if ($pt>=86400)
$p = date("F j",$t_time);
elseif ($pt>=3600)
$p = (floor($pt/3600))."h";
elseif ($pt>=60)
$p = (floor($pt/60))."m";
else
$p = $pt."s";
return $p;
}
if($_GET['search']!=""){
$hashtag = $_GET['search'];
include "connect.php";
if($_GET['recent'])
{
$queryxc = "SELECT id,post,user_id,timestamp,comments,views,likes,image,type,user2_id,tribe_id,role,op,repuser,value1link,value2link,post_id
FROM posts
WHERE location LIKE '%$hashtag%'
ORDER BY timestamp DESC
LIMIT 30
";
$query=mysqli_query($conn, $queryxc) or die(mysql_error());
mysqli_close($conn);
}else{
$queryxc = "SELECT id,post,user_id,timestamp,comments,views,likes,image,type,user2_id,tribe_id,role,op,repuser,roles,value1,value2,value1a,value2a,value1link,value2link,post_id
FROM posts
WHERE location LIKE '%$hashtag%'
ORDER BY views DESC
LIMIT 30
";
$query=mysqli_query($conn, $queryxc) or die(mysql_error());
mysqli_close($conn); }
if(mysqli_num_rows($query)>0){
while ($row = mysqli_fetch_array($query)) {
$content = $row['post'];
$id = $row['id'];
$uid= $row['user_id'];
$views = $row['views'];
$likes = $row['likes'];
$comments = $row['comments'];
$imagess = $row['image'];
$type = $row['type'];
$userwhoid = $row['user2_id'];
$tribed = $row['tribe_id'];
$role= $row['role'];
$realp= $row['op'];
$repo= $row['repuser'];
$value1= $row['value1'];
$value2= $row['value2'];
$value1a= $row['value1a'];
$value2a= $row['value2a'];
$roles= $row['roles'];
$t_time = $row['timestamp'];
$value1link= $row['value1link'];
$value2link= $row['value2link'];
$post_id = $row['post_id'];
include "connect.php";
$queryxcs = "SELECT avatar,id,username,name,pbackcolor,stats FROM users WHERE id='$uid'
";
$cool=mysqli_query($conn, $queryxcs);
while ($wow = mysqli_fetch_assoc($cool)) {
$image = $wow['avatar'];
$name = $wow['name'];
$username = $wow['username'];
$postcolor=$wow['pbackcolor'];
$stats=$wow['stats'];
}
mysqli_close($conn);
//Get User Info Of The Recepient
if($userwhoid)
{ include "connect.php";
$queryxcsw ="SELECT avatar,id,username,name FROM users WHERE id='$userwhoid'
";
$cools=mysqli_query($conn, $queryxcsw) or die(mysql_error());
while ($wow = mysqli_fetch_assoc($cools)) {
$imagex = $wow['avatar'];
$namex = $wow['name'];
$usernamex = $wow['username'];
$userdx = $wow['id'];
}
mysqli_close($conn);
}
//Get Tribe Info
if($tribed)
{ include "connect.php";
$queryxcsw = "SELECT avatar,id,name FROM tribes WHERE id='$tribed'
";
$cools=mysqli_query($conn, $queryxcsw) or die(mysql_error());
while ($wow = mysqli_fetch_assoc($cools)) {
$imagex = $wow['avatar'];
$namexs = $wow['name'];
$tribex = $wow['id'];
}
mysqli_close($conn);
}
if($repo)
{ include "connect.php";
$coolsah = "SELECT avatar,id,username,name,auth FROM users WHERE id='$repo'
";
$coolst=mysqli_query($conn, $coolsah) or die(mysql_error());
while ($wow = mysqli_fetch_assoc($coolst)) {
$imagexrep = $wow['avatar'];
$repname = $wow['username'];
$userdxrep = $wow['id'];
}
mysqli_close($conn);
}
$ago= getTime($t_time);
//This converts everything with @ and # to a clickable link
$content = preg_replace('/@(\\w+)/','
<a href=userprofile.php?username=$1>
$0</a>',$content);
$content = preg_replace('/#(\\w+)/','
<a href=hashtag.php?hashtag=$1>
$0</a>',$content);
//Replace www. with a link https:
$content = preg_replace ("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"https://\\2\" target=\"_blank\">\\2</a>", $content);
include "timeline.php";
}
}
else{
echo "
<div class='social_networks'>
<ul><li><a href='index.php' class='facebook'><i></i><span>No posts were found with #$hashtag</span><div class='clear'></div></a></li></ul>
</div>
";
}
} else{
echo "
<div class='social_networks'>
<ul><li><a href='index.php' class='googleplus'><i></i><span>Sorry, invalid search!</span><div class='clear'></div></a></li></ul>
</div>
";
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>