smarty / nats help needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HunkyLuke
    Virgin by request ;)
    • Feb 2002
    • 1924

    #1

    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
Working...