cvs: pearweb /public_html/map index.php
| From: | Helgi �ormar �orbj�rnsson | Date: | Wed, 16 Apr 2008 22:31:12 +0000 |
| Subject: | cvs: pearweb /public_html/map index.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-7478@lists.php.net to get a copy of this message | ||
dufuz Wed Apr 16 22:31:12 2008 UTC
Modified files:
/pearweb/public_html/map index.php
Log:
Tweak the code even more to handle empty result set and some other goodies
This also fixes Bug #13534 Map view fails to render well if 0 entries
http://cvs.php.net/viewvc.cgi/pearweb/public_html/map/index.php?r1=1.14&r2=1.15&diff_format=u
Index: pearweb/public_html/map/index.php
diff -u pearweb/public_html/map/index.php:1.14 pearweb/public_html/map/index.php:1.15
--- pearweb/public_html/map/index.php:1.14 Wed Apr 16 22:02:45 2008
+++ pearweb/public_html/map/index.php Wed Apr 16 22:31:12 2008
@@ -15,7 +15,7 @@
* @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.14 2008/04/16 22:02:45 dufuz Exp $
+ * @version $Id: index.php,v 1.15 2008/04/16 22:31:12 dufuz Exp $
*/
$maps = array(
'world' =>
@@ -85,12 +85,15 @@
$infos = array();
if (empty($infos)) {
response_header('PEAR Maps');
- report_warning('No users with geo info were found');
-} elseif (isset($_GET['handle']) && !empty($_GET['handle']) &&
empty($infos)) {
- response_header('PEAR Maps');
echo '<h1>PEAR Developer Locations</h1>';
- echo '<p>User <strong>' . $handle . '</strong> does not have
latitude & longitude set.</p>';
-} else {
+ if (isset($_GET['handle']) && !empty($_GET['handle'])){
+ report_error('User <strong>' . $handle . '</strong> does not
have latitude & longitude set.');
+ } else {
+ report_error('No users have latitude & longitude data set');
+ }
+}
+
+if (!empty($infos)) {
$map = '<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key='
. $_SERVER['Google_API_Key'] . '"></script>';
response_header('PEAR Maps', false, $map);
?>
@@ -100,7 +103,8 @@
The map below contains the locations of the PEAR developers who have added
their location to their user profile.
</p>
- <noscript>
+
+<noscript>
<?php
echo '<h1>Maps Links</h1>';
foreach ($maps as $map) {
@@ -110,9 +114,9 @@
}
echo '<hr noshade="noshade"/>';
?>
- </noscript>
- <script language="javascript" type="text/javascript">
+</noscript>
+<script type="text/javascript">
points = new Array();
<?php
foreach ($infos as $info) {
@@ -120,7 +124,7 @@
}
?>
</script>
-<script language="javascript" type="text/javascript"
src="../javascript/peardev_map.js"></script>
+<script type="text/javascript"
src="../javascript/peardev_map.js"></script>
<div style="width: 100%; height: 500px; border: 1px solid black;"
id="peardev_map">
</div>
@@ -135,7 +139,7 @@
?>
<?php
if (!empty($infos)) {
- $showMap = '<script language="javascript"
type="text/javascript">showfullmap();</script>';
+ $showMap = '<script
type="text/javascript">showfullmap();</script>';
response_footer(false, $showMap);
} else {
response_footer();