forked from MrTechno84/master-login-system
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprofile.php
More file actions
114 lines (66 loc) · 2.93 KB
/
profile.php
File metadata and controls
114 lines (66 loc) · 2.93 KB
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
<?php
/**
* MASTER LOGIN SYSTEM
* @author Mihai Ionut Vilcu (ionutvmi@gmail.com)
* June 2013
*
*/
include 'inc/init.php';
if(!isset($_GET["u"]) || !($u = $db->getRow("SELECT * FROM `".MLS_PREFIX."users` WHERE `userid`= ?i", $_GET["u"]))){
$page->error = "User doesn't exists or it was deleted !";
$u = new stdClass();
$u->username = 'Guest';
}
$page->title = "Profile of ". $options->html($u->username);
include 'header.php';
if(isset($page->error))
$options->fError($page->error);
$show_actions = ''; // holds the actions links
if($user->group->canban && $user->hasPrivilege($u->userid) && ($user->data->userid != $u->userid))
$show_actions .= "<li><a href='$set->url/mod.php?act=ban&id=$u->userid'><i class='icon-ban-circle'></i> ".($u->banned ? "Un" : "")."Ban ".$options->html($u->username)."</a></li>";
if($user->group->canhideavt && $user->hasPrivilege($u->userid))
$show_actions .= "<li><a href='$set->url/mod.php?act=avt&id=$u->userid'><i class='icon-eye-close'></i> ".($u->showavt ? "Hide" : "Show")." avatar</a></li>";
if(($user->data->userid == $u->userid) || ($user->group->canedit && $user->hasPrivilege($u->userid)))
$show_actions .= "<li><a href='$set->url/user.php?id=$u->userid'><i class='icon-pencil'></i> Edit profile</a></li>";
if($user->isAdmin() && $user->data->userid != $u->userid)
$show_actions .="<li><a href='$set->url/mod.php?act=del&id=$u->userid'><i class='icon-trash'></i> Delete ".$options->html($u->username)."</li>";
$tooltip = ''; // holds the tooltip data
if($user->data->userid == $u->userid) {
$tooltip = " rel='tooltip' title='change avatar'";
}
// show data based on privacy
$extra_details = '';
$privacy = $db->getRow("SELECT * FROM `".MLS_PREFIX."privacy` WHERE `userid` = ?i", $u->userid);
$group = $db->getRow("SELECT * FROM `".MLS_PREFIX."groups` WHERE `groupid` = ?i", $u->groupid);
if($privacy->email == 1 || $user->isAdmin())
$extra_details .= "<b>Email:</b> ". $options->html($u->email)."<br/>";
echo "<div class='container'>
<h3 class='pull-left'>Profile of ".$options->html($u->username)."</h3>";
if($show_actions != '')
echo "<div class='btn-group pull-right'>
<a class='btn dropdown-toggle' data-toggle='dropdown' href='#'>
Actions
<span class='caret'></span>
</a>
<ul class='dropdown-menu'>
$show_actions
</ul>
</div>";
echo "
<div class='clearfix'></div>
<hr>
<div class='row'>
<div class='span3'>
<a href='http://gravatar.com'$tooltip>
<img src='".$user->getAvatar($u->userid, 240)."' width='240' class='img-polaroid' alt='".$options->html($u->username)."'>
</a>
<div style='text-align:center;'><b>".$user->showName($u->userid)." (".$options->html($u->username).") </b></div>
</div>
<div class='span7 well' style='margin:10px;'>
<b>Rank:</b> ".$options->html($group->name)."<br/>
<b>Last seen:</b> ".$options->tsince($u->lastactive)."<br/>
$extra_details
</div>
</div>
</div>";
include 'footer.php';