rdconnell
Forum Replies Created
-
Forum: Plugins
In reply to: [DistanceFromMe] [Plugin: DistanceFromMe] Alternate useI had a play about and got something working using a geolocation plugin to store the lat/lng in the post and then distancefromme to extract the values and display the distance in a post. There are a couple of minor niggles with the geolocation plugin, for example it doesn’t seem to store/display the address text correctly, but it has a nice UI to enter the location details and saved me doing it for now ??
The plugin creates a space in the post for the text to go and then calls the javascript function to populate it with the correct details. Hopefully you should be able to change the code to use your own custom fields instead if thats more useful.
The rest of the code is pretty much the same as before as all I did was add the shortcode details to the .php file and modified the distance function in the .js file to accept a source for writing the results back to.
I noticed the same issue as yourself with the user locations being a bit inconsistent but it generally gives the correct location after the user refreshes the page once. Not the ideal solution but I couldn’t find anything better and since this was just for fun I didn’t look too hard.
Hopefully this is useful in what your trying to do as well. If nothing else it was a good idea and I learned some new stuff while doing it so definitely worthwhile ??
Forum: Plugins
In reply to: [DistanceFromMe] [Plugin: DistanceFromMe] Alternate useHi, Sounds like a good idea. I had a quick look and it looks possible to do. Looks like I need to add a couple of custom fields to hold the lat/lng and then display the ‘your are xx from this post’ text on post the users can see.
I will give it a go and see what I can do.
Thanks for the feedback and apologies for the delay in replying, I was on holiday and didn’t see your comment until today.