cvs: pearweb /doc apache-setup.txt /public_html/map index.php
| From: | Martin Jansen | Date: | Thu, 04 Jan 2007 10:52:51 +0000 |
| Subject: | cvs: pearweb /doc apache-setup.txt /public_html/map index.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-5329@lists.php.net to get a copy of this message | ||
mj Thu Jan 4 10:52:51 2007 UTC
Modified files:
/pearweb/doc apache-setup.txt
/pearweb/public_html/map index.php
Log:
Several improvements to the map system:
* The Google API Key is now stored in the Apache configuration, which makes
it possible to also test the map on other hosts without changing the key
in the PHP code.
* The map now completely uses the available browser window width.
* Misc. text improvements
http://cvs.php.net/viewvc.cgi/pearweb/doc/apache-setup.txt?r1=1.31&r2=1.32&diff_format=u
Index: pearweb/doc/apache-setup.txt
diff -u pearweb/doc/apache-setup.txt:1.31 pearweb/doc/apache-setup.txt:1.32
--- pearweb/doc/apache-setup.txt:1.31 Thu Oct 26 18:46:56 2006
+++ pearweb/doc/apache-setup.txt Thu Jan 4 10:52:51 2007
@@ -15,6 +15,8 @@
# SSLCertificateKeyFile /usr/local/apache2/ssl/pear.php.net.key
# SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
+ SetEnv Google_API_Key
"ABQIAAAAjPqDvnoTwt1l2d9kE7aeSRSaX3uuPis-gsi6PocQln0mfq-TehSSt5OZ9q0OyzKSOAfNu8NuLlNgWA"
+
php_value include_path .:/path/to/pearweb/include:/usr/share/pear
php_value auto_prepend_file pear-prepend.php
php_value auto_append_file pear-append.php
http://cvs.php.net/viewvc.cgi/pearweb/public_html/map/index.php?r1=1.9&r2=1.10&diff_format=u
Index: pearweb/public_html/map/index.php
diff -u pearweb/public_html/map/index.php:1.9 pearweb/public_html/map/index.php:1.10
--- pearweb/public_html/map/index.php:1.9 Fri Dec 15 18:43:14 2006
+++ pearweb/public_html/map/index.php Thu Jan 4 10:52:51 2007
@@ -1,7 +1,6 @@
<?php
-
/**
- * The Developers location's map system
+ * The Developers locations map system
*
* This source file is subject to version 3.0 of the PHP license,
* that is bundled with this package in the file LICENSE, and is
@@ -16,16 +15,14 @@
* @author David Coallier <davidc@php.net>
* @copyright Copyright (c) 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License
- * @version $Id: index.php,v 1.9 2006/12/15 18:43:14 mj Exp $
+ * @version $Id: index.php,v 1.10 2007/01/04 10:52:51 mj Exp $
*/
-$map = '
-<script type="text/javascript" language="javascript" src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjPqDvnoTwt1l2d9kE7aeSRSaX3uuPis-gsi6PocQln0mfq-TehSSt5OZ9q0OyzKSOAfNu8NuLlNgWA"></script>
-';
-response_header('PEAR Maps', false, $map);
+$map = '<script type="text/javascript" language="javascript"
src="http://maps.google.com/maps?file=api&v=2&key='
. $_SERVER['Google_API_Key'] . '"></script>';
+response_header('PEAR Maps', false, $map);
?>
-<h1>PEAR Developer's locations!</h1>
+<h1>PEAR Developer Locations</h1>
<?php
$maps = array(
'world' =>
@@ -72,12 +69,9 @@
);
?>
<p>
- This map contains the location of the PEAR developers that were kind enough
- to put their location or close to their location up there. If you need support
- just visit the <?php print_link('/support/', 'support page'); ?>.
- <br /></p>
- <p>Now that you are ready to proceed:</p>
- <br />
+ The map below contains the locations of the PEAR developers who have added
+ their location to their user profile.
+</p>
<noscript>
<?php
print '<h1>Maps Links</h1>';
@@ -88,7 +82,7 @@
}
print '<hr noshade="noshade"/>';
?>
- </noscript>
+ </noscript>
<script language="javascript" type="text/javascript">
@@ -96,7 +90,7 @@
<?php
$sql = "
- SELECT latitude, longitude, handle, homepage, IF(showemail,email,'') as email
+ SELECT latitude, longitude, name, handle
FROM users
WHERE latitude <> ''
AND longitude <> ''
@@ -104,12 +98,7 @@
$infos = $dbh->getAll($sql);
foreach ($infos as $info) {
- echo "points.push([
- '{$info[0]}',
- '{$info[1]}',
- '{$info[2]}',
- '{$info[3]}',
- '{$info[4]}']);\n";
+ echo "points.push(['" . addslashes($info[0]) . "', '" .
addslashes($info[1]) . "', '" . addslashes($info[2]) . "',
'" . addslashes($info[3]) . "']);\n";
}
?>
@@ -117,19 +106,19 @@
</script>
<script language="javascript" type="text/javascript"
src="../javascript/peardev_map.js"></script>
-<div style="width: 80%; height: 300px; border: none;"
+<div style="width: 100%; height: 500px; border: 1px solid black;"
id="peardev_map">
</div>
<?php
-$showMap = '
-<script language="javascript" type="text/javascript">
-tmp = document.getElementById(\'peardev_map\');
-tmp.style.border = \'1px solid black\';
+if ($auth_user && empty($auth_user->latitude)) {
+ echo "<p><strong>Tip:</strong> You can add your coordinates in your
"
+ . make_link("/account-edit.php?handle=" . $auth_user->handle, "profile")
+ . ".</p>";
+}
+?>
+<?php
+$showMap = '<script language="javascript" type="text/javascript">
showfullmap();
-
-</script>
-';
+</script>';
response_footer(false, $showMap);
-
-?>