• Resolved joinpete

    (@joinpete)


    I am in the US and, since it is based on IP address and I do not have the ability to change mine, I need a way to either test this or I need an example or two.

    I need to display different content for those in the USA vs these specific countries –

    United Kingdom
    Spain
    Germany
    France
    Italy
    Canada
    China
    Japan
    Brazil
    Mexico
    India

    Obviously I don’t expect you to code anything here. I am using this plugin directly in my PHP code and it works great for United States (I tested “If not in usa, display something else” statement which passed).

    If I use <?php do_shortcode(‘[cf_geo return=”country”]’) ?>, what will the values returned be? Exactly what I have above for each respective country? or would say, Spain, return “Espana”?

    There is just not a good way to confidently say that I am delivering the content based on their location without traveling to these countries and testing it myself (without using a proxy).

    Thanks! (great plugin, by the way)

    https://ww.wp.xz.cn/plugins/cf-geoplugin/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author INFINITUM FORM

    (@creativform)

    Thanks for using our plugin and this great question.

    We spend months to made more accurate informations and made this plugin more better.

    After version 3.x, geoplugin return all country informations in English (US) language. To compare in PHP you can do something like this:

    <?php
    $country = strtolower(do_shortcode('[cf_geo return="country"]'));
    switch($country)
    {
     default: break;
     case 'india': break;
     case 'germany': break;
      //- etc.
    }
    ?>

    This is basic switcher what you can made in your template.

    Realy soon this plugin will have in next version ability where you can setup content based on visitor location.

    We are also opened to help you and assists if you need some more development.

    Thread Starter joinpete

    (@joinpete)

    Awesome! That was a great way to utilize the functionality.

    Plugin Author INFINITUM FORM

    (@creativform)

    If want to be 100% shure that this work properly, you can use Country Code property and you will not have any kind of problem. Here is example:

    <?php
    $country = strtolower(do_shortcode('[cf_geo return="country_code"]'));
    switch($country)
    {
     default: break;
     case 'in': break;
     case 'de': break;
     case 'us': break;
     case 'rs': break;
      //- etc.
    }
    ?>

    This is from my side more clean and fast solution.

    Also you can first separate content by continent code and inside it country code to get more possibilities.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Explain Parameters’ is closed to new replies.