Page 1 of 1
Content Shown based on visitors geographic location
Posted: Tue Jun 15, 2010 2:27 pm
by colleen
I am looking for a module that i can use to show different content based on the geographic location of the visitor ... Is there such a module? If someone could point me in the right direction i would appreciate it.
Thanks
Re: Content Shown based on visitors geographic location
Posted: Tue Jun 15, 2010 7:27 pm
by kermit
there's a plugin in the forge that works with hostip.info. you can get the country using that, then go from there in your templates and pages.
http://dev.cmsmadesimple.org/project/code/54
usage would go something like this:
Code: Select all
{geohostip}
<p>That was one heck of a Cup this year{if $geohostip.Country eq 'CA'}, eh?{else}!{/if}</p>
one note: the plugin requires a writable 'cache' folder: (cmsmsroot)/plugins/cache
Re: Content Shown based on visitors geographic location
Posted: Tue Jun 15, 2010 10:03 pm
by colleen
Thank You I will test this and see how it goes.
Re: Content Shown based on visitors geographic location
Posted: Mon Jun 21, 2010 6:30 pm
by colleen
I have been fighting with this plug in for the last week. I have been trying to add the UDT for geohostip. Every time i try and add it i get a message that there is an error in the code. I see it hasn't been updated in a long time is this still a valid plug in?
Re: Content Shown based on visitors geographic location
Posted: Mon Jun 21, 2010 7:14 pm
by kermit
that's because it's NOT a udt.
it's a file, called "function.geohostip.php" that goes in the "plugins" directory of your cmsms install (it will appear in the 'tags' menu). and then for this one, you also need to create a php-writeable directory inside plugins called "cache"
Re: Content Shown based on visitors geographic location
Posted: Mon Jun 21, 2010 8:03 pm
by colleen
I was following the instructions posted for installing a plug in ... I did do what what said as well and it still wasn't working ... I will continue playing with it.
C
Re: Content Shown based on visitors geographic location
Posted: Tue Jun 22, 2010 9:08 am
by kermit
colleen wrote:
I was following the instructions posted for installing a plug in ... I did do what what said as well and it still wasn't working ... I will continue playing with it.
colleen wrote:
i get a message that there is an error in the code.
the above tells me you're trying copy and paste the contents of the file into a UDT via the admin area. don't do that. upload the file called "function.geohostip.php" to the 'plugins' directory instead. then create a directory called 'cache' inside that plugins directory and make sure that php can write to it (same permissions as 'tmp', 'cache', etc. when you initially installed cmsms. once you do those things, go into the 'tags' page in the admin area (
not ' user defined tags') and you should see it show up in that list
Re: Content Shown based on visitors geographic location
Posted: Tue Jun 22, 2010 12:08 pm
by colleen
I did try both but since the documentation I found said to do the UDT that was all i said I did.
Thank you for your help