cvs: pearweb /public_html/map index.php locationREST.php

From: Date: Sun, 10 Dec 2006 19:54:32 +0000
Subject: cvs: pearweb /public_html/map index.php locationREST.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-5245@lists.php.net to get a copy of this message
arnaud Sun Dec 10 19:54:32 2006 UTC Added files: /pearweb/public_html/map index.php locationREST.php Log: adding parts of the developer maps (By David and Christian) http://cvs.php.net/viewvc.cgi/pearweb/public_html/map/index.php?view=markup&rev=1.1 Index: pearweb/public_html/map/index.php +++ pearweb/public_html/map/index.php <?php /** * The Developers location's 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 * available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. * If you did not receive a copy of the PHP license and are unable to * obtain it through the world-wide-web, please send a note to * license@php.net so we can mail you a copy immediately. * * @category pearweb * @package Maps * @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.1 2006/12/10 19:54:32 arnaud Exp $ */ $map = ' <script language="javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjPqDvnoTwt1l2d9kE7aeSRTvq1EzFJ2An5H6gf53tkxXc1_4QRTnOsnCZUu9PPUZxp0ZM7HYMmpIew"></script> '; response_header('PEAR Maps', false, $map); ?> <h1>PEAR Developer's locations!</h1> <?php $maps = array( 'world' => array('name' => 'World Maps', 'link' => 'http://pear.cweiske.de/devmaps/peardev-world.jpg', ), 'northamerica' => array('name' => 'North America Maps', 'link' => 'http://pear.cweiske.de/devmaps/peardev-northamerica.jpg', ), 'southamerica' => array('name' => 'South America Maps', 'link' => 'http://pear.cweiske.de/devmaps/peardev-southamerica.jpg', ), 'europe' => array('name' => 'Europe Maps', 'link' => 'http://pear.cweiske.de/devmaps/peardev-europe.jpg', ), ); ?> <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 support's page : <br /><br /></p> <p>Now that you are ready to proceed:</p> <br /> <noscript> <?php $gets = $_GET; if (!isset($gets['region'])) { print '<h1>Maps Links</h1>'; print '<a href="index.php?region=world&js=no">World Map</a><br />'; print '<a href="index.php?region=europe&js=no">Europe Map</a><br />'; print '<a href="index.php?region=northamerica&js=no">North America Map</a><br />'; print '<a href="index.php?region=southamerica&js=no">South America Map</a><br />'; print '<hr noshade/>'; } if (isset($gets['region']) && isset($gets['js']) && $gets['js'] == 'no') { print '<a href="index.php">List Maps</a><br />'; $mapContent = ''; $region = $gets['region']; switch (strtolower($region)) { case 'world': case 'europe': case 'northamerica': case 'southamerica': $mapContent = ' <h1>'.$maps[$region]['name'].'</h1> <a href="'.$maps[$region]['link'].'"> <img style="width: 90%; height: 400"; border; 1px solid black; src="'.$maps[$region]['link'].'" alt="'.$maps[$region]['name'].'"/></a> '; break; } print $mapContent; } ?> </noscript> <br /><br /> <?php print_link('/support/', 'support channels'); ?>. </p> <script language="javascript" type="text/javascript"> points = new Array(); <?php $sql = " SELECT latitude, longitude, handle, homepage, email FROM users "; $infos = $dbh->getAll($sql); foreach ($infos as $info) { echo "points.push([ '{$info[0]}', '{$info[1]}', '{$info[2]}', '{$info[3]}', '{$info[4]}']);\n"; } ?> </script> <script language="javascript" type="text/javascript" src="../javascript/peardev_map.js"></script> <div style="width: 80%; height: 300px; border: none;" id="peardev_map"> </div> <?php $showMap = ' <script language="javascript" type="text/javascript"> tmp = document.getElementById(\'peardev_map\'); tmp.style.border = \'1px solid black\'; showfullmap(); </script> '; response_footer(false, $showMap); ?> http://cvs.php.net/viewvc.cgi/pearweb/public_html/map/locationREST.php?view=markup&rev=1.1 Index: pearweb/public_html/map/locationREST.php +++ pearweb/public_html/map/locationREST.php <?php /** * The Developers location's map system XML Built * * 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 * available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. * If you did not receive a copy of the PHP license and are unable to * obtain it through the world-wide-web, please send a note to * license@php.net so we can mail you a copy immediately. * * @category pearweb * @package Maps * @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: locationREST.php,v 1.1 2006/12/10 19:54:32 arnaud Exp $ */ $sql = "SELECT name, latitude, longitude, homepage, handle FROM users WHERE latitude <> '' AND longitude <> ''"; $query = $dbh->getAll($sql, DB_FETCHMODE_ASSOC); /** * Why use any other dependencies, we are just * not on php5 yet, so we can't use DOM or * xmlwriter. Let's just build custom XML */ $xml = '<?xml version="1.0" encoding="UTF-8" ?>' . "\n"; $xml .= ' <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://xmlns.com/foaf/0.1/"> '; foreach ($query as $parts => $key) { $xml .= "\t<Person>\n"; $xml .= "\t\t<name>{$key['name']}</name>\n"; $xml .= "\t\t<homepage dc:title=\"{$key['handle']}\"\n"; $xml .= "\t\t rdf:resource=\"{$key['homepage']}\"/>\n"; $xml .= "\t\t<based_near geo:lat=\"{$key['latitude']}\"\n"; $xml .= "\t\t geo:long=\"{$key['longitude']}\" />\n"; $xml .= "\t</Person>\n"; } $xml .= "</rdf:RDF>\n"; header ("Content-Type: application/xml"); print $xml; ?>

« previous php.pear.core (#5245) next »