• This plugin might exist allready, but I couldn’t find using google, so here it is ??
    The plugin gives you four functions you can use in your blog:
    get_geoip_country_code and get_geoip_country_name returns the the visitors country code / name
    the_geoip_country_code and the_geoip_country_name echos the the visitors country code / name
    INSTALLATION:
    1) Extract the plugin into your WordPress plugins directory.
    2) Download the free GeoIP country database from MaxMind , and extract it into your plugins/GeoIP directory
    3) Optional, If you need country flags, you’ll find them here: https://www.maxmind.com/download/geoip/database/flag.zip
    4) Activate it on the Plugins tab of the WordPress admin console.
    SAMPLE USE:
    <img src="/flag/<?php echo strtolower(get_geoip_country_code())?>.gif" alt="<?php the_geoip_country_name()?>" />
    NOTE, If you have full access to your server and it’s running Apache, you should take a look at the mod_geoip

Viewing 12 replies - 1 through 12 (of 12 total)
  • Can you help me with this please?
    Here is the error:
    Parse error: parse error in /home/tekwh0re/public_html/wp/wp-content/plugins/GeoIP.php on line 53

    Thread Starter Per S?derlind

    (@pers)

    Is that the only error message you get? How are you using the plugin? Could you post your code (the part using the plugin)


    <?php if ($comments) { ?>
    <ol id="commentlist">
    <?php foreach ($comments as $comment) { ?>
    <li id="comment-<?php comment_ID() ?>">
    <img src="<?php gravatar("R",60,"https://www.tekwh0re.net/images/dookie.jpg"); ?>alt="" align="left" /><?php comment_text() ?>
    <?php comment_type(); ?> <?php _e("by"); ?> <?php comment_author_link() ?> <img src="/flag/<?php echo strtolower(get_geoip_country_code())?>.gif" alt="<?php the_geoip_country_name()?>" />
    <?php if (comment_subscription_status()) { echo "(subscribed to comments)"; } ?>
    — <?php comment_date() ?> @ "><?php comment_time() ?> </cite> <?php edit_comment_link(__("Edit This"), ' |'); ?>

    Hello Folks
    I’ve got the same error as Tek but because i use a windows server mt paths are slightly different
    “Parse error: parse error, unexpected T_VARIABLE in c:\inetpub\wwwroot\wordpress\wp-content\plugins\GeoIP.php on line 53”
    Any idea’s
    Cheers
    James
    https://home.puerilis.co.uk/wordpress/index.php

    =(

    Thread Starter Per S?derlind

    (@pers)

    I think I found the bug, in geoip.inc there’s a trailing space after the ?>
    Remove the space, and please tell me if that fixed the problem. (I’ve updated the zip)

    ^^ did you get in yet?

    If a plugin is causing problems, then use your ftp or cpanel to rename the plugin file – that will stop it loading.
    It may also cause errors if you are using code from that plugin, so you will need to edit whichever files you have to remove such code.

    Is this working yet??

    The error is that you cannot pass variables as default argument values (see https://www.php.net/manual/en/functions.arguments.php).
    In line 53:
    function get_geoip_country_code($ip = $_SERVER["REMOTE_ADDR"]) { should be changed to something like:
    function get_geoip_country_code($ip = NULL) {
    if (is_null($ip)) {
    $ip = $_SERVER["REMOTE_ADDR"];
    }

    Also note that there is a missing closing parenthesis in all your realpath calls.

    There is also this plugin to display the country code or flag. It may be easier to use for some people, (there is no mucking with mod-rewrite).

    https://frenchfragfactory.net/ozh/archives/2004/08/27/ip-to-nation-plugin/

    I have activate geo ip,to my blog,and now,when I go to my homepage,I see:

    Parse error: parse error, unexpected T_VARIABLE in /home/delfinsb/public_html/wp-content/plugins/GeoIP/GeoIP.php on line 53

    If I go in my space ftp,and I del the directory GeoIP,in my homepage,I see another error… What can I do?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘GeoIP plugin’ is closed to new replies.