Changeset 1530 in ExiteCMS for trunk/downloads.php


Ignore:
Timestamp:
07/08/08 18:10:05 (4 years ago)
Author:
hverton
Message:

added new "external download" field to downloads, to indicate which process is counting downloads

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/downloads.php

    r1468 r1530  
    7171        // and the user has access to it... 
    7272        if (checkgroup($cdata['download_cat_access'])) { 
    73             // update the download counter (if we're using internal statistics) 
    74             if (!isset($settings['dlstats_remote']) || !$settings['dlstats_remote']) $result = dbquery("UPDATE ".$db_prefix."downloads SET download_count=download_count+1 WHERE download_id='$download_id'"); 
     73            // update download counter  
     74            if ($data['download_external']) { 
     75                // do nothing, an external module will update the counters 
     76            } else { 
     77                $result = dbquery("UPDATE ".$db_prefix."downloads SET download_count=download_count+1 WHERE download_id='$download_id'"); 
     78                // download module installed but no external stats collector active? 
     79                if (isset($settings['dlstats_remote']) && !$settings['dlstats_remote']) { 
     80                    // Then update the IP counters for mapping purposes 
     81                    if (USER_IP != "0.0.0.0") { 
     82                        $result = dbquery("INSERT INTO ".$db_prefix."dlstats_ips (dlsi_ip, dlsi_ccode, dlsi_counter) VALUES ('".USER_IP."', '".USER_CC."', '1') ON DUPLICATE KEY UPDATE dlsi_counter = dlsi_counter + 1"); 
     83                    } 
     84                } 
     85            } 
    7586            // if a URL is given for the download, redirect to it, else fall back to the download category 
    7687            if ($data['download_url']) { 
    7788                // download statistics plugin installed but no remote stats used? Then update the IP counters 
    7889                if (isset($settings['dlstats_remote']) && !$settings['dlstats_remote']) { 
    79                     if (USER_IP != "0.0.0.0") { 
    80                         $result = dbquery("INSERT INTO ".$db_prefix."dlstats_ips (dlsi_ip, dlsi_ccode, dlsi_counter) VALUES ('".USER_IP."', '".USER_CC."', '1') ON DUPLICATE KEY UPDATE dlsi_counter = dlsi_counter + 1"); 
    81                     } 
    8290                } 
    8391                redirect($data['download_url']); 
Note: See TracChangeset for help on using the changeset viewer.