X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=lib%2Ffunctions.php;h=6a39ddd3383a804040a36b55d26d8f51811f0ba9;hb=4adf3d2450a0fbcd4ec1aa5a5c78afb2088847f3;hp=f1e714582ee156e1cab828de32f854390874fc8e;hpb=3d5b79f8ac44a4964253d7d6d4d251db03498ce5;p=readifood.git diff --git a/lib/functions.php b/lib/functions.php index f1e7145..6a39ddd 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -320,7 +320,32 @@ 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)); + # mrt=loc specifies a location search. + $map = "maps.google.co.uk/maps?q=" . urlencode($postcode) . "&mrt=loc"; + $url = "http://$map"; + # output=embed allows display in an iframe. + # iwloc=near hides the popup window for the embedded view. + $embed = $GLOBALS['http'] . "://$map&output=embed&iwloc=near"; + $html = " "; + $html .= get_small_link_with_id("map", "Map", $url); + $html .= ""; + return $html; } } @@ -557,7 +582,7 @@ echo call_user_func_array("get_small_link", func_get_args()); } - include_once("$lib_root/admin.php"); - include_once("$lib_root/forms.php"); + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "admin.php"))); + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "forms.php"))); ?>