forked from php/web-people
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.php
113 lines (99 loc) · 3.11 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
<?php
/* $Id$ */
require "./include/layout.php";
require "./include/misc.php";
require "./include/karma.php";
$USERNAME = filter_input(INPUT_GET, "username", FILTER_SANITIZE_ENCODED, FILTER_FLAG_STRIP_HIGH);
site_header("PHP: Developers Profile Pages; $USERNAME");
$NFO = findPHPUser($USERNAME);
$PEAR = findPEARUser($USERNAME);
$GITHUB = findGitHubUser($NFO["name"]);
$KARMA = findKarma($USERNAME);
$PROFILE = findPHPUserProfile($USERNAME);
$email = $NFO["enable"] ? $NFO["username"].'@php.net' : "";
$location = isset($PEAR["long"], $PEAR["lat"]) ? $PEAR["lat"] . ", " . $PEAR["long"] : null;
?>
<div about="#me" typeof="foaf:Person" id="profile">
<?php
if ($email) {
echo '<span rel="foaf:img"><img rel="foaf:img" src="http://www.gravatar.com/avatar/', md5($email), '.jpg" alt="Picture of ', $NFO["name"], '" height="80" width="80" /></span>';
}
?>
<dl>
<dt>Summary</dt>
<dd>
<?php
if ($NFO["name"]) {
echo '<span property="foaf:name">', $NFO["name"], '</span>';
}
?>
(<span property="foaf:nick"><?php echo $NFO["username"]?></span>)
a member of <a href="http://www.php.net" rel="foaf:Organization">PHP</a>
<?php
if (isset($GITHUB["company"])) {
echo ', currently working for ', $GITHUB["company"];
}
if (isset($GITHUB["location"])) {
echo ', living in ';
if ($location) {
$q = urlencode($location);
echo '<a href="http://maps.google.com/?q=', $q, '">', $GITHUB["location"], '</a>';
} else {
echo $GITHUB["location"];
}
}
?>
.
</dd>
<?php if ($email) { ?>
<dt>Email</dt>
<dd><a rel="foaf:mbox" href="mailto:<?php echo $email ?>"><?php echo $email ?></a></dd>
<?php } ?>
<?php if (isset($GITHUB["blog"])) { ?>
<dt>Weblog</dt>
<dd><a rel="foaf:weblog" href="<?php echo $GITHUB["blog"]?>"><?php echo $GITHUB["blog"]?></a></dd>
<?php } ?>
<?php if (isset($GITHUB["company"])) { ?>
<dt>Employer</dt>
<dd><?php echo $GITHUB["company"]?></dd>
<?php } ?>
<?php if (isset($GITHUB["location"])) { ?>
<dt>Location</dt>
<dd><?php echo $GITHUB["location"] ?></dd>
<?php } ?>
<?php if (isset($PEAR["long"], $PEAR["lat"])) { ?>
<dt>Geo location</dt>
<?php $q = urlencode($location) ?>
<dd><a href="http://maps.google.com/?q=<?php echo $q ?>"><span property="geo:lat"><?php echo $PEAR["lat"]?></span>, <span property="geo:long"><?php echo $PEAR["long"]?></span></a></dt>
<?php } ?>
</dl>
<?php if ($PROFILE) { ?>
<h2 id="blurb">About:</h2>
<div class="blurb">
<?php echo $PROFILE; ?>
</div>
<?php } ?>
<?php if ($KARMA) { ?>
<?php $KARMA = formatKarma($KARMA); ?>
<h2 id="karma">Karma:</h2>
<ul>
<?php if (count($KARMA) > 0) { ?>
<?php foreach ($KARMA as $path) { ?>
<li><?php echo $path ?></li>
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
<?php if ($NFO["notes"]) { ?>
<h2 id="notes">Notes:</h2>
<?php } ?>
<?php foreach($NFO["notes"] as $note) { ?>
<div class="note">
<?php echo $note["entered"] ?>:
<?php echo htmlspecialchars($note["note"], ENT_QUOTES, 'UTF-8'); ?>
</div>
<?php } ?>
</div>
<?php
site_footer();
// vim: set expandtab shiftwidth=4 softtabstop=4 tabstop=4 :