[dev] Turba Mapquest URL...

Marc Jauvin marc at register4less.com
Tue Dec 3 18:29:17 2002


Here is a patch to make the MapQuest URL work with canadian addresses as well.

Index: display.inc
===================================================================
RCS file: /repository/turba/templates/display/display.inc,v
retrieving revision 1.31
diff -r1.31 display.inc
59c59
<             preg_match('|(.*)\n(.*)\s*,\s*(\w+)\s*(\d+)|',
$this->object->getValue($key), $addressParts);
---
>            
preg_match('/(.*)\n(.*)\s*,\s*(\w+)\s+(\d+|[a-zA-Z]\d[a-zA-Z]\s?\d[a-zA-Z]\d)/',
$this->object->getValue($key), $addressParts);
60a61,62
>                       $mapurl = Horde::addParameter($mapurl, 'size=big&zoom=7');
>
71a74,77
>
>                               if
(preg_match('|[a-zA-Z]\d[a-zA-Z]\s?\d[a-zA-Z]\d|', $addressParts[4])) {
>                                       $mapurl = Horde::addParameter($mapurl,
'country=CA');
>                               }





--<marc

http://Register4less.com
tel.: 450-441-5458



More information about the dev mailing list