cvs: php-people-web / user.php
| From: | Hannes Magnusson | Date: | Sun, 07 Jun 2009 15:45:42 +0000 |
| Subject: | cvs: php-people-web / user.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-4993@lists.php.net to get a copy of this message | ||
bjori Sun Jun 7 15:45:42 2009 UTC
Modified files:
/php-people-web user.php
Log:
I have very poor copy&paste skillz
http://cvs.php.net/viewvc.cgi/php-people-web/user.php?r1=1.1&r2=1.2&diff_format=u
Index: php-people-web/user.php
diff -u php-people-web/user.php:1.1 php-people-web/user.php:1.2
--- php-people-web/user.php:1.1 Sun Jun 7 15:35:14 2009
+++ php-people-web/user.php Sun Jun 7 15:45:41 2009
@@ -1,19 +1,84 @@
<?php
-/* $Id: user.php,v 1.1 2009/06/07 15:35:14 bjori Exp $ */
+/* $Id: user.php,v 1.2 2009/06/07 15:45:41 bjori Exp $ */
require "./include/layout.php";
+require "./include/misc.php";
$USERNAME = filter_input(INPUT_GET, "username", FILTER_SANITIZE_ENCODED,
FILTER_FLAG_STRIP_HIGH);
-if ($USERNAME) {
- header("Location: /user.php?username=$USERNAME");
- exit;
-}
+site_header("PHP: Developers Profile Pages; $USERNAME");
-site_header("PHP: Developers Profile Pages");
+$NFO = findPHPUser($USERNAME);
+$PEAR = findPEARUser($USERNAME);
+$GITHUB = findGitHubUser($NFO["name"]);
+$email = $NFO["enable"] ? $NFO["username"].'@php.net' :
"";
+$location = isset($PEAR["long"], $PEAR["lat"]) ? $PEAR["lat"] .
", " . $PEAR["long"] : null;
?>
- <p class="warning smaller"><strong>WARNING</strong>: This is
obviously work in progress :)</p>
- <p>Use the searchbox to search for usernames/names</p>
+<div about="#me" typeof="foaf:Person" id="profile">
+<?php
+if ($email) {
+ echo '<span rel="foaf:img"><img rel="foaf:img" src="https://secure.gravatar.com/avatar.php?gravatar_id=',
md5($email), '" alt="Picture of ', $NFO["name"], '"
height="80" width="80" /></span>';
+}
+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"];
+ }
+}
+?>
+.
+<dl>
+<?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 ($NFO["notes"]) { ?>
+ <h2 id="notes">Notes:</h2>
+<?php } ?>
+<?php foreach($NFO["notes"] as $note) { ?>
+ <div class="note">
+ <?php echo $note["entered"] ?>:
+ <?php echo $note["note"] ?>
+ </div>
+<?php } ?>
+</div>
<?php
site_footer();