Changeset 559 for trunk/Modules/Referrer


Ignore:
Timestamp:
Jul 31, 2013, 1:52:32 PM (11 years ago)
Author:
chronos
Message:
  • Fixed: Referrers was not logged correctly.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Referrer/Referrer.php

    r548 r559  
    3838      $HostName = substr($Referrer, strpos($Referrer, '/') + 2);
    3939      $HostName = substr($HostName, 0, strpos($HostName, '/'));
    40       if(in_array($HostName, $this->Excludes))
     40      if(!in_array($HostName, $this->Excludes))
    4141      {
    42         $DbResult = $System->Database->query('SELECT `Id` FROM `Referrer` WHERE `Web` = "'.$HostName.'"');
     42        $DbResult = $this->System->Database->query('SELECT `Id` FROM `Referrer` WHERE `Web` = "'.$HostName.'"');
    4343        if($DbResult->num_rows > 0)
    4444        {
    4545          $DbRow = $DbResult->fetch_assoc();
    46           $System->Database->query('UPDATE `Referrer` SET `Hits` = `Hits` + 1, `DateLast` = NOW(), `LastURL` = "'.
     46          $this->System->Database->query('UPDATE `Referrer` SET `Hits` = `Hits` + 1, `DateLast` = NOW(), `LastURL` = "'.
    4747            addslashes($Referrer).'" WHERE `Id` = '.$DbRow['Id']);
    48         } else $System->Database->query('INSERT INTO `Referrer` (`Web`, `DateFirst`, `DateLast`, `LastURL`, `Hits`) '.
     48        } else $this->System->Database->query('INSERT INTO `Referrer` (`Web`, `DateFirst`, `DateLast`, `LastURL`, `Hits`) '.
    4949                'VALUES ("'.$HostName.'", NOW(), NOW( ), "'.addslashes($Referrer).'", 1)');
    5050      }
Note: See TracChangeset for help on using the changeset viewer.