コード例 #1
0
ファイル: pois.php プロジェクト: radicaldesigns/eaa-map
<?php

require_once '../../start.php';
if ($state = request_params('state')) {
    $groups = GroupPeer::published_and_geocoded_by_state($state);
} else {
    $groups = GroupPeer::published_and_geocoded();
}
header(' Content-Type:text/xml');
print '<?xml version="1.0" encoding="UTF-8"?>';
?>
<POIs>
<?php 
foreach ($groups as $group) {
    print "  <POI label=\"" . htmlspecialchars($group->getName()) . "\" lat=\"" . $group->getLat() . "\" lon=\"" . $group->getLon() . "\" id=\"" . $group->getCdatKey() . "\" category=\"event_district\" location=\"" . htmlspecialchars($group->getCity()) . ", " . htmlspecialchars($group->getState()) . "\" description=\"" . htmlspecialchars($group->getDescription()) . "\" contact_name=\"" . htmlspecialchars($group->getContactName()) . "\" contact_email=\"" . htmlspecialchars($group->getEmail()) . "\" url=\"" . $group->getUrl() . "\">\n";
    $url = $group->getUrl();
    if (strpos($url, "http") !== 0) {
        $url = "http://" . $url;
    }
    print "    <action url=\"" . $url . "\" event=\"onRelease\" target=\"_blank\"/>\n";
    print "  </POI>\n";
}
?>
</POIs>