cvs: pearweb /public_html/map locationREST.php
| From: | Helgi �ormar �orbj�rnsson | Date: | Thu, 20 Mar 2008 19:55:51 +0000 |
| Subject: | cvs: pearweb /public_html/map locationREST.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-7340@lists.php.net to get a copy of this message | ||
dufuz Thu Mar 20 19:55:51 2008 UTC
Modified files:
/pearweb/public_html/map locationREST.php
Log:
Partially fixes Request #13187 Improve the RDF being output by pearweb
http://cvs.php.net/viewvc.cgi/pearweb/public_html/map/locationREST.php?r1=1.3&r2=1.4&diff_format=u
Index: pearweb/public_html/map/locationREST.php
diff -u pearweb/public_html/map/locationREST.php:1.3 pearweb/public_html/map/locationREST.php:1.4
--- pearweb/public_html/map/locationREST.php:1.3 Wed Sep 5 14:40:13 2007
+++ pearweb/public_html/map/locationREST.php Thu Mar 20 19:55:51 2008
@@ -15,12 +15,18 @@
* @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.3 2007/09/05 14:40:13 davidc Exp $
+ * @version $Id: locationREST.php,v 1.4 2008/03/20 19:55:51 dufuz Exp $
*/
$sql = "SELECT name, latitude, longitude, homepage, handle
FROM users WHERE latitude <> '' AND longitude <> ''";
-$query = $dbh->getAll($sql, DB_FETCHMODE_ASSOC);
+$data = array();
+if (isset($_GET['handle']) && !empty($_GET['handle'])) {
+ $sql .= ' AND handle = ?';
+ $data[] = htmlspecialchars($_GET['handle']);
+}
+
+$query = $dbh->getAll($sql, $data, DB_FETCHMODE_ASSOC);
/**
* Why use any other dependencies, we are just
* not on php5 yet, so we can't use DOM or
@@ -31,18 +37,25 @@
<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: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<Person rdf:about=\"#{$key['handle']}\">\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\t<holdsAccount>\n";
+ $xml .= "\t\t\t<OnlineAccount>\n";
+ $xml .= "\t\t\t\t<accountServiceHomepage rdf:resource=\"/\" />\n";
+ $xml .= "\t\t\t\t<accountProfilePage
rdf:resource=\"/user/{$key['handle']}\" />\n";
+ $xml .=
"\t\t\t\t<accountName>{$key['handle']}</accountName>\n";
+ $xml .= "\t\t\t</OnlineAccount>\n";
+ $xml .= "\t\t</holdsAccount>\n";
$xml .= "\t</Person>\n";
}
$xml .= "</rdf:RDF>\n";