-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprofile.php
More file actions
98 lines (92 loc) · 3.46 KB
/
profile.php
File metadata and controls
98 lines (92 loc) · 3.46 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
<?php
/*
@! AuthManager v3.0
@@ User authentication and management web application
-----------------------------------------------------------------------------
** author: StitchApps
** website: http://www.stitchapps.com
** email: support@stitchapps.com
** phone support: +91 9871084893
-----------------------------------------------------------------------------
@@package: am_authmanager3.0
*/
include("init.php");
include(USER_DIRECTORY."/header.php");
$page_title = _("Error");
$_loader = false;
if(isset($_GET["id"])) {
$id = intval($_GET["id"]);
if(!empty($id)) {
try {
$profile_query = "SELECT * FROM `members` WHERE `id` = :id";
$profile_query_check = $db->prepare($profile_query);
$profile_query_check->bindParam(':id', $id, PDO::PARAM_INT);
$profile_query_check->execute();
$ac = $db->query("SELECT FOUND_ROWS()")->fetchColumn();
} catch(PDOException $e) {
$log->logError($e." - ".basename(__FILE__));
}
if(!empty($ac)) {
$_loader = true;
$fetch = $profile_query_check->fetch (PDO::FETCH_ASSOC);
$user_fn = cleanInput($fetch['first_name']);
$user_ln = cleanInput($fetch['last_name']);
$page_title = $user_fn." ".$user_ln._("'s profile");
$email_user = cleanInput($fetch['email']);
$user_bio = cleanInput($fetch['bio']);
if(empty($user_bio)) {
$user_bio = "<h6>"._("The user has not entered any information in this section. You can check back some time later to see any changes made over here.")."</h6>";
} else {
$user_bio = nl2br($user_bio);
}
$user_join = cleanInput($fetch['join']);
$user_access = cleanInput($fetch['access']);
$user_fb = cleanInput($fetch['fb_id']);
if(!empty($user_fb)) {
$fb_link = "<a href=\"http://www.facebook.com/profile.php?id={$user_fb}\">"._("Facebook Profile")."</a>";
} else {
$fb_link = null;
}
}
}
}
subheader($page_title);
if($_loader == true) {
/*
displaying gravatar photo over here if email is associated with a gravatar account.
*/
$default = $website."/images/anonuser_50px.gif";
$gravatar = new Gravatar($email_user, $default);
$gravatar->size = 50;
?>
<div class="page-header no-border">
<h1><img class="profilephoto thumbnail" src="<?php echo $gravatar->getSrc(); ?>" /> <?php echo $user_fn." ".$user_ln; ?></h1>
</div>
<div class="row">
<div class="span6">
<div class="page-header no-border">
<h3><?php echo _("About Me"); ?></h3>
</div>
<p><?php echo $user_bio; ?></p><br/>
</div>
<div class="span6">
<div class="page-header no-border">
<h3><?php echo _("Info"); ?></h3>
</div>
<table class="table table-bordered table-striped table-condensed">
<tr><td class="first"><?php echo _("Name"); ?></td><td><?php echo $user_fn." ".$user_ln; ?></td></tr>
<tr><td class="first"><?php echo _("Email"); ?></td><td><?php echo $email_user; ?></td></tr>
<tr><td class="first"><?php echo _("Joined On"); ?></td><td><?php echo $user_join; ?></td></tr>
<tr><td class="first"><?php echo _("Last Access"); ?></td><td><?php echo $user_access; ?></td></tr>
<tr><td class="first"><?php echo _("Facebook"); ?></td><td><?php echo $fb_link; ?></td></tr>
</table>
</div>
</div><br/><br/>
<?php } else { ?>
<div class="page-header no-border">
<h1><img class="profilephoto thumbnail" src="<?php echo $website."/images/anonuser_50px.gif"; ?>" /> <?php echo _("Add User"); ?></h1>
</div>
<?php
}
include(USER_DIRECTORY."/footer.php")
?>