com web/people: Drop the geo coordinates from PEAR, its exceptionally slow and noone uses it: include/misc.php user.php
| From: | Hannes Magnusson | Date: | Mon, 30 Dec 2013 05:03:20 +0000 |
| Subject: | com web/people: Drop the geo coordinates from PEAR, its exceptionally slow and noone uses it: include/misc.php user.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-17905@lists.php.net to get a copy of this message | ||
Commit: e7e77cf62306f504c654fd1383ed6bca2809833e
Author: Hannes Magnusson <bjori@mongodb.com> Sun, 29 Dec 2013 21:03:20 -0800
Parents: 72e7bc7e2e8c1531026dc88c651c7aebd281d954
Branches: master
Link: http://git.php.net/?p=web/people.git;a=commitdiff;h=e7e77cf62306f504c654fd1383ed6bca2809833e
Log:
Drop the geo coordinates from PEAR, its exceptionally slow and noone uses it
Changed paths:
M include/misc.php
M user.php
Diff:
diff --git a/include/misc.php b/include/misc.php
index 49825f4..78b1ffb 100644
--- a/include/misc.php
+++ b/include/misc.php
@@ -68,18 +68,6 @@ function findGitHubUser($fullname)
return $retval;
}
-function findPEARUser($username)
-{
- $geo = getDOMNodeFrom("http://pear.php.net/map/locationREST..php?handle="
. $username, "based_near");
- if (!$geo) {
- return;
- }
- return array(
- "lat" => $geo->getAttribute("geo:lat"),
- "long" => $geo->getAttribute("geo:long"),
- );
-}
-
function cached($url, $options = false, $ctx = null)
{
$tmpdir = sys_get_temp_dir();
diff --git a/user.php b/user..php
index acd48b1..12aaf9f 100644
--- a/user.php
+++ b/user.php
@@ -9,12 +9,10 @@ $USERNAME = filter_input(INPUT_GET, "username", FILTER_SANITIZE_ENCODED,
FILTER_
site_header("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;
+$email = $NFO["username"].'@php.net';
?>
<section class="mainscreen">
@@ -70,12 +68,6 @@ if (isset($GITHUB["location"])) {
<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) { ?>
@@ -97,14 +89,14 @@ if (isset($GITHUB["location"])) {
</ul>
<?php } ?>
-<?php if ($NFO["notes"]) { ?>
+<?php if (!empty($NFO["notes"])) { ?>
<h2 id="notes">Notes:</h2>
-<?php } ?>
-<?php foreach($NFO["notes"] as $note) { ?>
+ <?php foreach($NFO["notes"] as $note) { ?>
<div class="note">
<?php echo $note["entered"] ?>:
<?php echo htmlspecialchars($note["note"], ENT_QUOTES, 'UTF-8');
?>
</div>
+ <?php } ?>
<?php } ?>
</div>