View Single Post
Old 12-11-2007, 01:21 PM  
HunkyLuke
Virgin by request ;)
 
Industry Role:
Join Date: Feb 2002
Posts: 1,924
smarty / nats help needed

I am trying to geotarget a couple of pages in our nats system.

I have already had the mod_geoip apache module and db installed on my server. I am now trying to create a smarty plugin and use it within a nats template page to do the actual geotargeting - but I am stumped and need help.

Here is what I have done so far:
I created and uploaded a file called function.country.php into my nats/Smarty-2.6.14/libs/plugins directory with the following code:
PHP Code:
<%
$country apache_note("GEOIP_COUNTRY_CODE");
%> 
I modified my page template file and added the following code to test:
PHP Code:
{if $country == "US"}
    <
You are in the US
{elseif $country == "PA"}
    <
You are in Panama
{else}
    
You are not in the US or Panama
{/if} 
But when visiting the page, all visitors get "you are not in the US or Panama" even though I am testing from those two locations.

What am I doing wrong?

thanks
Luke
HunkyLuke is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote