-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
296 lines (246 loc) · 12.3 KB
/
profile.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
<?php
//do not require user account
$defaultAllowNoUser = true;
require("./garage/passport.php");
if (isset($_GET['refs'])){
$visitedProfile = mysqli_real_escape_string($conne, $_GET['refs']); //make ref a var
//check if user is same as ref requested if so send to profile page instead
if ($visitedProfile == $username){
header('Location: /me');
}}
else{}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!--every link on thispage is absolute cus of the htaccess redirect-->
<?php
//get profileof user being viewed
if (isset($_GET['refs'])){
$findusercookie = mysqli_query($conne,"SELECT * FROM profiles WHERE username = '$visitedProfile' LIMIT 1");
$confirmcookie = 0;
while($gotuser = mysqli_fetch_array($findusercookie))
{$confirmcookie = 1;
$visitedProfilecookie = $gotuser['cookie'];
$probepfullname = $gotuser['fullname']; $pfullname = htmlspecialchars($probepfullname, ENT_QUOTES);
//just to be safe, do username aswell. future update will cover everything
$probepusername = $gotuser['username']; $pusername = htmlspecialchars($probepusername, ENT_QUOTES);
}
if ($confirmcookie == 0){
$visitedProfilecookie = "nil"; #couldnt find user by name. doesnt exist
$pfullname = "Vrixe Profile";
$pusername = "username";
}
echo "<title> $pfullname - @$pusername | Vrixe</title>
<meta name='description' content='Connect with $pfullname on Vrixe.'>
<meta property='og:description' content=' Connect with $pfullname on Vrixe. ' />
<meta property='og:title' content='$pfullname - @$pusername | Vrixe ' />
<meta property='og:url' content='https://www.vrixe.com/profile/$pusername' />
<meta property='og:image' content='https://vrixe.com/images/vogo.png' />" ;
}
else {echo "<title>Profile</title>";
$pfullname = "Vrixe Profile";}#redirect would have hanled this
?>
<link rel="manifest" href="/manifest.json">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" x-undefined=""/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"/>
<?php require("./garage/resources.php"); ?>
<meta name="robots" content="noindex">
<meta name="googlebot" content="noindex">
<style> body{background-color: #f5f5f5;} </style>
</head>
<body>
<?php require("./garage/absolunia.php"); ?>
<div id="gtr" onclick="closecloseb()"></div>
<?php
require("./garage/validuser.php");
require("./garage/deskhead.php");
require("./garage/desksearch.php");
require("./garage/deskpop.php");
?>
<?php $pagename = "<button class='hbut' id='mbut' aria-label='vrixe' onclick='window.history.back()'><i class='material-icons' style='vertical-align: top;'>keyboard_arrow_left</i>$pfullname</button>";
require("./garage/mobilehead.php");
require("./garage/subhead.php");
require("./garage/thesearch.php"); ?>
<br>
<?php
//get visited profiles info
if (isset($_GET['refs'])){
$start = mysqli_query($conne,"SELECT * FROM profiles WHERE cookie = '$visitedProfilecookie' LIMIT 1");
$confirm = 0;
while($gotuser = mysqli_fetch_array($start)){
$confirm = 1;
//just to be safe, do username aswell. future update will cover everything
$probepusername = $gotuser['username']; $pusername = htmlspecialchars($probepusername, ENT_QUOTES);
$$visitedProfileemail = $gotuser['email'];
$probebio = $gotuser['bio']; $bio = htmlspecialchars($probebio, ENT_QUOTES);
$probelink = $gotuser['link']; $link = htmlspecialchars($probelink, ENT_QUOTES);
$probelocation = $gotuser['location']; $location = htmlspecialchars($probelocation, ENT_QUOTES);
$picture = $gotuser['picture'];
$usercid = $gotuser['cid'];
$fines = "cid = " . $usercid;
//check if user is already following
$foundUserInContactList = substr_count($mycontacts, $fines);
echo "<div class='postcen' style='margin-top:0px'>
<h id='evin' class='rates'>Check out Events from $pusername on Vrixe</h>
<div class='profilebox'>
<div id='profilespread'>
<button title='Share profile link' id='profilesettings' onclick='customshare(\"$pusername\", \"profile/$pusername\");' type='button'><i class='material-icons'>share</i></button>
<form action='/help/feedbacks.php' method='post' style='display:initial'>
<input type='text' value='$pusername' name='refs' class='rates'>
<input type='text' id='controllers' name='controllers' class='rates'>
<button title='Report Profile' aria-label='profile actions' id='editpencil'><i class='material-icons'>info</i></button><br><br>
</form>
<img src='$picture' class='profilephoto' alt='$pusername'><br><br>
<div id='pwb'>
$pfullname <br><div id='cateuser'> @$pusername </div>
<p class='minis' style='width:98%;margin:auto'> $bio<br>
<a href='https://$link' class='underlink'> $link </a>
</p>
<br><br>
<div id='locationfl'><i class='material-icons' style='font-size: 17px;vertical-align: sub;'>location_on</i> $location</div>
<div id='usernamefl'>@$pusername</div>
</div>
</div>
<br>
<div id='result'></div>";
if($foundUserInContactList >= 1 ){
echo"<script>
var iv$usercid = 'or cid = $usercid ';
var cu$usercid = '$username';
var req$usercid = 'delete contact';
</script>
<button aria-label='delete contact' title='Delete Contact' class='control' onclick='process(req$usercid, iv$usercid, cu$usercid)'><i class='material-icons' style='font-size: 17px;vertical-align: sub;'>person_add_disabled</i> Remove Contact</button>";
}else{
echo"<script>
var iv$usercid = 'or cid = $usercid ';
var cu$usercid = '$username';
var req$usercid = 'add contact';
var pjs$pusername = '$pusername';
</script>
<button aria-label='add contact' title='Add Contact' class='control' onclick='process(req$usercid, iv$usercid, cu$usercid, pjs$pusername)'><i class='material-icons' style='font-size: 17px;vertical-align: sub;'>person_add</i> Add To Contacts</button>";
}
echo"<br><br>
</div>
</div>
</div>";
//get visited profiles events
$year = date("Y.md");
$holder = mysqli_query($conne,"SELECT * FROM events WHERE hype = '$pusername' and class = 'public' or hype = '$pusername' and cua = '$username' and '$username' > '' or hype = '$pusername' and cub = '$username' and '$username' > '' or hype = '$pusername' and cuc = '$username' and '$username' > '' or hype = '$pusername' and cud = '$username' and '$username' > '' or hype = '$pusername' and cue = '$username' and '$username' > '' or hype = '$pusername' and cuf = '$username' and '$username' > '' ORDER BY year DESC LIMIT 15");
$gotyourevents = 0;
echo "<div class='postcen'>";
while($row2 = mysqli_fetch_array($holder)){
//funny enough, short text out from strlen is making evil cut off. but still we shall put here too hahahaah
$gotyourevents = 1;
$r = $row2['refs'];
$probedescription = $row2['description']; $description = htmlspecialchars($probedescription, ENT_QUOTES);
$dlent = strlen($description);
$date = $row2['dates'];
$probeeem = $row2['event']; $eem = htmlspecialchars($probeeem, ENT_QUOTES);
$status = $row2['status'];
$month = $row2['month'];
$year = substr($row2['year'], 0,4);
$imagename = $row2['imgthumb'];
$kilas = $row2['class'];
$views = $row2['views'];
$elent = strlen($eem);
$cua = $row2['cua'];
$cub = $row2['cub'];
$cuc = $row2['cuc'];
$cud = $row2['cud'];
$cue = $row2['cue'];
$cuf = $row2['cuf'];
//set update position to where who uploaded what are you in cahrge of and get user position
if ($username == $cua){$userposition = "cua";}
else if ($username == $cub){$userposition = "cub";}
else if ($username == $cuc){$userposition = "cuc";}
else if ($username == $cud){$userposition = "cud";}
else if ($username == $cue){$userposition = "cue";}
else if ($username == $cuf){$userposition = "cuf";}
//check if user is authorised to edit event
if($username > "" and $username == $cua or $username > "" and $username == $cub or $username > "" and $username == $cuc or $username > "" and $username == $cud or $username > "" and $username == $cue or $username > "" and $username == $cuf){
$governorOnPage = true;
}else{$governorOnPage = false;}
//image background set
if($imagename == "default.png"){
$cardBack = "background: linear-gradient(45deg, #252b38 0%, #252b38 44%,rgb(43, 52, 67) 44%, rgb(43, 52, 67) 45%,rgb(43, 52, 67) 61%, rgb(43, 52, 67) 67%,#0298ad 67%, #0298ad 100%)";
}else{
$cardBack = "background-image:url(\"/images/eventnails/$imagename\")";
}
echo "<div class='cards' style='$cardBack'><br>
<button class='cardsactions' onclick='share$r()' title='Share Event'><i class='material-icons'>share</i><br>share</button>";
//if user has edit access
if($governorOnPage){
echo"<a href='/desk.php?code=$r'><button class='cardsactions' title='Edit Event'><i class='material-icons'>edit</i><br>edit</button></a>";
echo"<button class='cardsactions' id='$r' onclick='leavePlan(\"$r\", \"$username\", \"$userposition\")' title='Remove yourself from an event. Your last changes will still apply'><i class='material-icons'>indeterminate_check_box</i><br>Leave</button>";
}
if ($elent > 18){
$newee = substr($eem, 0, 17);
$shortee = "$newee...";
}
else { $shortee = $eem; }
echo "<a href='event/$r'>
<div class='cardtitle'>$shortee <i class='material-icons' style='font-size:17px;vertical-align:sub;color:#00f2a2'>arrow_forward</i></div>
</a>";
if ($dlent > 26){
$ndescri = substr($description, 0, 25);
$descr = "$ndescri...";
echo "<a href='event/$r'><h class='cardsdescription'>$descr</h></a><br> <a href='profile/$pusername'><h class='cardsdescription underlink'>by @$pusername | $month $year</h></a>";
}
else {echo "<a href='event/$r'><h class='cardsdescription'>$description</h></a><br> <a href='profile/$pusername'><h class='cardsdescription underlink'>by @$pusername | $month $year</h></a>";}
echo "<br><br></div>
<script>
function share$r(){
var cst = \"$eem\";
var csl = 'event/$r';
customshare(cst, csl);
}
</script>";
}
if($gotyourevents == 0){//user has no events
echo "<div class='pef' style='display:inline-block'>
<div class='blfhead'>...No public events</div><br><br>
<img alt='No public events' src='/images/essentials/create.svg' class='everybodyimg'><br>
<h class='miniss'>@$pusername has no public events</h><br><h class='disl'>...wonder what $pusername is planning? No more! send an invite and make something happen</h> <br><br>
<a href='/invite'><button class='copele'><i class='material-icons' style='vertical-align:sub;font-size:17px'>add_circle</i> Create Invite</button></a><br><br>
<h class='miniss'>More</h><br>
<i class='material-icons' style='vertical-align:bottom;font-size:17px;color:#065cff'>add_to_home_screen</i><br>
<h class='miniss'>Tried the Vriexe PWA?<br><a href='/app/pwa.html'><button class='control'> Install Web App</button></a></h><br><br>
<div class='blfheadalt'></div>
</div><br><br><br>";
}
echo"</div>";
}
if($confirm == 0){
echo "<div class='pagecen'>
<br><div class='smallposts'>
<div class='blfhead'>No, bo, dy</div><br>
<img alt='invite' src='/images/essentials/contacts.svg' class='everybodyimg'><br>
<h class='miniss'>Find your plan mate</h><br>
<br><h>We did not find any user from that.<br> Know a <b>$visitedProfile</b> you'd like here?</h><br><br>
<br><br><button class='copele' onclick='customshare(\"Create and edit plans with me on Vrixe\", \"vrixe.com/aboutvrixe\");'><i class='material-icons' style='font-size:17px;vertical-align:sub'>person_add</i> Invite To Vrixe</button><br><br>
<div class='blfheadalt'></div>
</div><br>
</div>
";
}}
else {
echo "<div class='postcen'> <br>
<div class='pef' style='display:inline-block'>
<div class='blfhead'>...a place for all</div><br><br>
<img alt='SIgn up for Vrixe' src='images/essentials/contacts.svg' class='everybodyimg'><br>
<h class='miniss'>One place, all events for all teams</h><br><h class='disl'>Create, manage and edit events with friends.<br>Create polls, take agenda... right from your phone.</h> <br><br>";
if(isset($username) and $username > ""){
echo"<a href='/account/contacts'><button class='copele'><i class='material-icons' style='font-size:17px;vertical-align:sub'>perm_contact_calendar</i> My Contacts</button></a><br><br>";
}else{
echo"<a href='/index.php?q=profile_required'><button class='copele'><i class='material-icons' style='font-size:17px;vertical-align:sub'>person_add</i> Sign me up</button></a><br><br>";
}
echo"<br><h class='miniss'>Before you jump in<br><a href='./aboutvrixe'><button class='control'> Learn More</button></a></h><br><br>
<div class='blfheadalt'></div>
</div><br><br><br></div>";
}
?>
<br>
<?php require("garage/networkStatus.php"); ?>
</body>
</html>