Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Add geolocation to Forum Posts

playgraphplaygraph New
edited June 2014 in Vanilla 2.0 - 2.8

Has anybody figured out a way to add geolocation data to forum posts? I'm playing around with displaying discussions based on geolocation as opposed to categories or tags.

My thought is that custom lat and lng variables would be saved to each post. When a user goes to the site, only the posts within a certain location will be displayed. I can figure out how to capture teh lat and lng, it's just the other stuff like saving the vars to the posts and figuring out where the methods should go to display the correct the posts.

Just trying to figure out how to approach this within the Vanilla Forums code.

Comments

  • Options
    peregrineperegrine MVP
    edited June 2014

    html5 has a lat and long - however it is by user choice whether the want to allow it.

    other wise you have to map the ip address to location as pretty much the other plugins do.

    it would probably be easier to base off of user's ip, since it is already stored and just put a country flag in the post.
    there is probably a plug that does it or you could probably easily modify it. e.g. http://vanillaforums.org/addon/worldflags-plugin

    http://stackoverflow.com/questions/8941923/getting-country-code-from-google-maps-and-html-5-geolocation

    some people consider this an invasion of privacy and don't want to be mapped to a country. while you see no harm in it, others might prefer to be anonymous in this respect. Personally, I avoid all sites and forums that present information of this kind, that don;t give me a choice to opt-out of displaying certain info.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    You should use this and you won't be tracked by google analytics

    https://tools.google.com/dlpage/gaoptout

    To disable your location

    http://no-geolocation.blogspot.mx/

  • Options
    peregrineperegrine MVP
    edited June 2014

    he should provide that on his forum. as for me I solved it myself. I don't go back :)
    it should be an opt-in rather than opt-out.
    google analytics has nothing to do with display of country flag on post.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited June 2014

    I think it should be voluntary. Your symbol edit plugin can also be used to put flags there. And they can add either the flags or the sprite from the world flags plugin along with the css and they should be able to pull it off easy.

    They can also add the flag to their signature voluntarily.

  • Options

    or he could just use the profileextender and make country a field to enter. then display that in the discussion topics kind of like indexphoto does for OP's photo in posts.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yes there are million ways to do it without forcing disclosure...

  • Options

    The WordFlags plugin looks to be a good start. Now I need to just show posts based on specific locations.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    @playgraph said:
    I'm playing around with displaying discussions based on geolocation as opposed to categories or tags.

    That is a really bad idea. My company routes all EMEA traffic through one country. I've worked in another international company where they did the same. So I guess that this is not an exception. Your way of grouping posts wouldn't make sense for users behind such company routers.

    I would advice you look at that discussion http://vanillaforums.org/discussion/comment/209265 and also use tags for your plan.

    But if you want to do it with automatic geolocation recognition, I'd advice you present each visitor (not only authenticated users, but also anonymous visitors) with the country you have found by looking at their IP and ask if that is correct. Then store the country in the user table of for anonymous users in a cookie so that what you are doing is not based on wild guessing but really on users preferences.

    But to be honest: categories and tags are just made for what you want to build up with geolocations and so I think you're reinventing the wheel. And because you couldn't work without user interactions, you could as well use tags...

Sign In or Register to comment.