Changeset 1516 in ExiteCMS


Ignore:
Timestamp:
07/02/08 21:12:36 (4 years ago)
Author:
hverton
Message:

updated the GeoIP toolbox script to update the new download statistics tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/administration/tools/update_geoip_database.php

    r1457 r1516  
    120120                } 
    121121            } 
    122             // update the statistics table (if it exists) 
    123             if (dbtable_exists($db_prefix."dls_statistics")) { 
    124                 display("* Updating download statistics with an unknown country code."); 
    125                 $result = dbquery("SELECT * FROM ".$db_prefix."dls_statistics WHERE ds_cc = ''"); 
     122            // update the statistics ip table (if it exists) 
     123            if (dbtable_exists($db_prefix."dlstats_ips")) { 
     124                display("* Updating ip statistics with an unknown country code."); 
     125                $result = dbquery("SELECT * FROM ".$db_prefix."dlstats_ips WHERE dlsi_ccode = ''"); 
    126126                while ($data = dbarray($result)) { 
    127                     $cc = GeoIP_IP2Code($data['ds_ip']); 
     127                    $cc = GeoIP_IP2Code($data['dlsi_ip']); 
    128128                    if ($cc != "") {  
    129                         display("  * Updating country code for statistics record '".$data['ds_id']."'."); 
    130                         $result2 = dbquery("UPDATE ".$db_prefix."dls_statistics SET ds_cc = '".$cc."' WHERE ds_id = '".$data['ds_id']."'"); 
     129                        display("  * Updating country code for statistics record '".$data['dlsi_id']."'."); 
     130                        $result2 = dbquery("UPDATE ".$db_prefix."dlstats_ips SET dlsi_ccode = '".$cc."' WHERE dlsi_id = '".$data['dlsi_id']."'"); 
    131131                    } 
    132132                } 
Note: See TracChangeset for help on using the changeset viewer.