WordPress.org

Ready to get started?Download WordPress

Forums

StatPress Visitors
[Plugin: Statpress Visitors] Where did the TLD listing go? (8 posts)

  1. thirdoff
    Member
    Posted 1 year ago #

    Is there a way to get the TLD (com,net,edu,etc) back on the StatPressV page? I know I could see it on the info page of the IP but liked it in the lists.

    http://wordpress.org/extend/plugins/statpress-visitors/

  2. luciole135
    Member
    Plugin Author

    Posted 1 year ago #

    No, this information has been deleted because it is very inaccurate!

    The PHP function gethostbyaddr($ ip) which locates TLD is unfortunately not at all accurate and the data they are often false returns, which did not interest statistics. Also it works only ipv4 addresses (not with ipv6) and its use will soon be deprecated.

    However, if you care to have this information (very inaccurate), you must return to 1.4.3.

  3. thirdoff
    Member
    Posted 1 year ago #

    Thank you for your reply. I would like to compare the old table code to the new table code in hopes I can manually add the domain. COuld anyone point me to the right lines while I go look. Thank you.

  4. luciole135
    Member
    Plugin Author

    Posted 1 year ago #

    You must see in the function luc_StatAppend() in the statpress.php file:

    1)Add in these function :
    $domain = strtoupper(luc_Domain($ipAddress));

    with function luc_Domain($ip)
    {
    $host = gethostbyaddr($ip);
    if (preg_match('#^([0-9]{1,3}\.){3}[0-9]{1,3}$#', $host))
    return "";
    else
    return my_substr(strrchr($host, "."), 1);
    }
    2)add these line in the WordPress INSERT instruction of luc_StatAppend()
    'nation' => mysql_real_escape_string(strip_tags($domain)), dont forgot to add a %s too.

    2)You must add in luc_StatPressV_CreateTable
    the line
    nation TINYTEXT,
    to deactive and active these plugin without the deletion of the column

    Simply compare the function of 1.4.3 and 1.5, you will see what you must add...

  5. thirdoff
    Member
    Posted 1 year ago #

    ty ty

  6. luciole135
    Member
    Plugin Author

    Posted 1 year ago #

    I forgot to say too, you must delete these line :
    $wpdb->query("ALTER TABLE $table_name DROP COLUMN nation");
    in the function luc_StatPressV_CreateTable

  7. thirdoff
    Member
    Posted 1 year ago #

    I renamed the 1.5.X plugin folder and moved 1.4.3 back in its place. The domain column is back but it's blank. I am in the process of manually adding the edits. Maybe we could add this back in as an option with notes on how its not accurate or preferred but still available for people like me.

    I see "nation" but just to clarify, it is "domain" that I am interested. I assume you understand and this is the variable that handles the ".com" being listed.

  8. luciole135
    Member
    Plugin Author

    Posted 1 year ago #

    The Original statpress stored the language in the column "nation" because the designer made ​​a mistake: he confounded the language and country. What is wrong the Americans speak English and are not English.

    So, "Statpress reloaded" stored the internet domain in the same column. I did not change that, I kept the name "nation" because I used personal "Reloaded".

    I thought initially make an option but we must completely rewrite the code from Reloaded which is no longer valid.
    I will take a complete rewrite of the code to make it also available with ipv6 addresses.

    Meanwhile it is best to go back in 1.4.3 where you have an option in the "update" that allows to update Internet domains.

    But I would suggest doing this update on a site installed locally on your computer and not online because this update uses a lot of server resources.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic