-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.php
130 lines (127 loc) · 3.12 KB
/
user.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
<?php
include("functions.php");
$AV = new AV;
$userData = $AV->userData($AV->escapeString($_REQUEST['param']));
if(isset($_REQUEST['verify']) and strlen($_REQUEST['verify']) == 32) {
$verifyHash = $AV->escapeString($_REQUEST['verify']);
$AV->verifyUser($verifyHash);
$AV->redirect("/");
}
if(isset($_REQUEST['param']) and $userData == false)
$AV->pageNotFound();
$AV->parseHTMLContent();
$AV->templateHeader("{lang['profile-of']} {$userData['username']}", "", Array("profile"));
if($userData['privacy'] == 2 or $userData['id'] == $AV->currentUser['id']) {
?>
<div class="profile">
<div class="row">
<div class="col-md-4 avatar">
<img src="{{url}}/<?php print $userData['avatar']; ?>" />
</div>
<div class="col-md-8">
<div class="row">
<div class="col-md-12">
<h1><?php print $userData['username']; ?></h1>
</div>
</div>
<div class="row">
<div class="col-md-4">
<strong>0</strong> {lang['trips']}
</div>
<div class="col-md-4">
<strong>0</strong> {lang['follower']}
</div>
<div class="col-md-4">
<strong>0</strong> {lang['following']}
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<h3><?php print $userData['name'] . " " . $userData['surname']; ?></h3>
</div>
</div>
</div>
</div>
<div class="row feed">
<div class="col-md-12">
<div class="row trips">
<?php
$trips = $AV->getTrips($userData['id']);
if($trips != false): ?>
<div class="col-md-12">
<h2>{lang['trips-user-partecipating']}</h2>
</div>
<?php
foreach($trips as $trip) {
$destination = Array($trip['city'], $trip['country']);
$destination = implode(", ", $destination);
print "
<div class=\"trip col-md-4\">
<a href=\"{{url}}/viaggi/{$trip['slug']}/\">
<div class=\"background\">
<div class=\"overlay\"></div>
<img src=\"" . $AV->getTripImage($trip['city'], $trip['country']) . ")\" />
</div>
<div class=\"info\">
<div class=\"title\">
{$trip['title']}
</div>
<br />
<div class=\"destination\">
{$destination}
</div>
</div>
</a>
</div>";
}
endif; ?>
</div>
</div>
</div>
</div>
<?php
} elseif($userData['privacy'] == 1) {
?>
<div class="profile">
<div class="row">
<div class="col-md-4 avatar">
<img src="{{url}}/assets/images/no-avatar.png" />
</div>
<div class="col-md-8">
<div class="row">
<div class="col-md-12">
<h1><?php print $userData['username']; ?></h1>
</div>
</div>
<div class="row">
<div class="col-md-4">
<strong>0</strong> {lang['trips']}
</div>
<div class="col-md-4">
<strong>0</strong> {lang['follower']}
</div>
<div class="col-md-4">
<strong>0</strong> {lang['following']}
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<h3><?php print $userData['name'] . " " . $userData['surname']; ?></h3>
</div>
</div>
</div>
</div>
<div class="row feed">
<div class="col-md-12">
<div class="row trips">
<div class="col-md-12">{lang['private-profile']}</div>
</div>
</div>
</div>
</div>
<?php
}
$AV->templateFooter();
?>