Facebook
Twitter
YouTube
Flickr
OTHER WAYS TO
EXPLORE UNA-USA.ORG:



_sendRequest("address=" . urlencode(stripslashes($address))); } // end forward /** * Reverse search: string must be latitude and longitude * * @param float $lat * @param float $lng * @return obj $response */ public function reverseSearch($lat, $lng) { return $this->_sendRequest("latlng=" . (float) $lat . ',' . (float) $lng); } // end reverse /** * Search Address Components Object * * @param string $type * @return object / false */ public function searchAddressComponents($type) { foreach($this->response->results[0]->address_components as $k=>$found){ if(in_array($type, $found->types)){ return $found; } } return false; } /** * Parse JSON default values: map object values to readable content * * @param none * @return none */ private function _setDefaults() { $country = $this->searchAddressComponents("country"); $this->country_long = $country->long_name; $this->country_short = $country->short_name; $region = $this->searchAddressComponents("administrative_area_level_1"); $this->region_long = $region->long_name; $this->region_short = $region->short_name; $county = $this->searchAddressComponents("administrative_area_level_2"); $this->county_long = $county->long_name; $this->county_short = $county->short_name; $city = $this->searchAddressComponents("locality"); $this->city = $city->short_name; $this->address = $this->response->results[0]->formatted_address; $this->lat = $this->response->results[0]->geometry->location->lat; $this->lng = $this->response->results[0]->geometry->location->lng; $this->location_type = $this->response->results[0]->geometry->location_type; } // end set private function _sendRequest($search) { $api_key = "ABQIAAAA3_nWkOsxM3zcPAWpC_tANxSWHOdgBAC_-eSeGQFhIT_iXwykOhQexr0O47yGDV8Cfefill0WSroN_A"; // format this string with the appropriate latitude longitude #$url = 'http://maps.google.com/maps/geo?q=37.0870821,-76.4730122&output=csv&sensor=true_or_false&key=' . $api_key; $url = 'http://maps.googleapis.com/maps/api/geocode/json?'.$search.'&sensor=true'; echo "
url: ".$url; // make the HTTP request $data = @file_get_contents($url); $this->response = $jsondata = json_decode($data); #echo "
";
		#print_r($jsondata);

		if ($this->response->status == "OK") {
			// set some default values for reading
			$defaults = $this->_setDefaults();
			return $this->response;
		} 
		else 
		{
			echo "Geocoding failed, server responded: " . $this->response->status;
			return false;

		}
 
 
 }
 

 
} // end class
	


	pings;
	
	?>

	


print ) ? "" : "" ;


$display .= "
"; $display .= "

".$this->entry->title."

"; $display .= ( $this->entry->subtitle != '' ) ? "

".$this->entry->subtitle."

" : "" ; $display .= ( $this->entry->flag_hide_byline ) ? "" : "
".$this->entry->date_created_view."
"; if ( $this->entry->flag_rating == 1 ) { $display .= "
".$this->rating."
"; } $display .= ( $this->entry->flag_show_map == 1 ) ? "
" : "" ; $display .= "
".JHTML::_('content.prepare', $this->entry->entry_alltext)."
"; $display .= ( $this->topic_list != "" ) ? "
Labels: ".$this->topic_list."
" : ""; $display .= "
"; $display .= "
"; if ( $this->entry->flag_comments == 1) { $display .= "
"; $display .= "
"; $display .= ""; $display .= "
"; $display .= "

Comments:

"; #$display .= $this->pageNav; foreach($this->comments_list as $l): if ( ( $this->userid == $this->entry->id_josusers ) || ( $l->published == 1 ) ) { $display .= "
"; if ( $this->userid == $this->entry->id_josusers ) { $display .= "
".$l->title." ".$l->commstatus."
"; } else { $display .= "
".$l->title."
"; } $display .= "
".$l->comment."
"; $display .= ""; $display .= "
"; $display .= "
"; } endforeach; $display .= $this->pageNav; if ( $this->print ) { } else { #comment form $user =& JFactory::getUser(); $uid = $user->id; if ( $uid > 0 ) { $display .= "
"; $display .= "
"; $display .= "

Leave a Comment:

"; $display .= "
"; $display .= "Subject:
"; $display .= "
Comment:
"; $display .= JHTML::_( 'form.token' ); $display .= ""; $display .= ""; $display .= ""; $display .= ""; $display .= ""; $display .= ""; $display .= ""; $display .= ""; $display .= "

"; if ($this->entry->flag_moderation) { $display .= ""; $display .= "
"; } $display .= ""; #CAPTCHA ??? $display .= "
"; $display .= "
"; $modules =& JModuleHelper::getModules('blog_comments_autolog'); foreach ($modules as $module) { $display .= JModuleHelper::renderModule($module, array('style'=>'xhtml')); } } else { $display .="
"; $display .=""; $modules =& JModuleHelper::getModules('blog_comments_login'); if ($modules) { foreach ($modules as $module) { $display .= JModuleHelper::renderModule($module, array('style'=>'xhtml')); } } else { $display .= "
Error: Login Module not published. Publish Login module in blog_comments_login position to enable on-page login.
"; } } } $display .= "
"; } echo $display; ?>
The UN Foundation
1750 Pennsylvania Avenue NW
Suite 300
Washington, DC 20006

Tel: +1 202 887-9040
Fax: +1 202 887-9021

801 Second Avenue
9th Floor
New York, NY 10017

Tel: +1 212 697-3315
Fax: +1 212 697-3316

About Us
Contact Us
Programs
Leadership Dinner
Donate
Email Sign-up
Privacy