From: Iain Patterson Date: Mon, 13 May 2013 10:21:01 +0000 (-0400) Subject: Added get_address_map_link(). X-Git-Tag: 2013-05-13~3 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=1fb7460a871d2342eca8a99d5e6a4af26c019372;p=readifood.git Added get_address_map_link(). Function to return a Google Maps URL for an address. --- diff --git a/lib/functions.php b/lib/functions.php index 7a02b2a..73ea464 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -317,6 +317,13 @@ return $q->findOneById($address->getAreaId()); } + function get_address_map_link($address) { + $postcode = trim($address->getPostcode()); + if ($postcode) { + return " " . get_small_link("Map", "http://maps.google.co.uk/maps?q=" . urlencode($postcode)); + } + } + function get_contact_address($contact) { $q = new AddressQuery; return $q->findOneById($contact->getAddressId());