Geo Location in accounts (when creating an account)

9 posts by 4 authors in: Forums > CMS Builder
Last Post: December 7, 2015   (RSS)

By Damon - October 27, 2015

HI Zick,

Remove this line of code and the error message will be eliminated:

  if (!$accountsRecord) { dieWith404("Record not found!"); } // show error message if no record found

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Damon - October 27, 2015

HI Zick,

Remove this line of code and the error message will be eliminated:

  if (!$accountsRecord) { dieWith404("Record not found!"); } // show error message if no record found

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Mikey - October 27, 2015 - edited: October 27, 2015

Okay - I fell really stupid now : )

Thanks Damon... working perfectly now.

By Damon - October 27, 2015

No problem.  I often ask Ross to take a look at my code when I have trouble locating an error. A fresh pair of eyes really helps.

Glad it is working now!

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Codee - December 2, 2015

Hi Zicky,

I found your post here very interesting and I think it's what a client is going to need so, if you don't mind, let me ask a clarifying question or two...

Are you using the Geocoder plugin to create google map links for multiple accounts?  So, if you have 100 clients with accounts on said site, each client's php/html page would show their googlemap?

Have you had any challenges doing this...such as the geocoder possibly wanting to only provide googlemap info for just one account even though you have multiple accounts?

Thanks!

Equinox

By Mikey - December 2, 2015

Hey Equinox,

I'm not using Geocoder for the solution, but instead loading the LatLng directly into a URL that queries Google Maps (launched into a new browser window) once the link is clicked. Have a look at the code below... you can replace the <?php echo...> with some geo LatLng coordinates ( 40.7127  -74.0059 ) and see the results.

<a href="https://www.google.com/maps/place/@<?php echo htmlencode($accountsRecord['latitude']) ?>,<?php echo htmlencode($accountsRecord['longitude']) ?>,15z/data=!4m2!3m1!1s0x0:0x0" target="_blank">Geo Location</a>

Hope that helps clarify what and how I'm using it.

Zick

By Codee - December 2, 2015

Greetings Zicky,

Thank you for clarifying that!

Cheers!

By Twocans - December 7, 2015

great post thanks

Kenny