Changeset 462
- Timestamp:
- Apr 14, 2010, 6:58:33 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/banners.php
r460 r462 18 18 echo($BannerSmall.' <textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />'); 19 19 20 $DbResult = $System->Database->query('SELECT * FROM `Refer al` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)');20 $DbResult = $System->Database->query('SELECT * FROM `Referrer` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)'); 21 21 22 22 echo('<br/><strong>Servery odkazující na nás:</strong> <br /> -
trunk/includes/global.php
r460 r462 30 30 $LanguageList = GetLanguageList(); 31 31 32 LogRefer al();32 LogReferrer(); 33 33 34 34 function GetMicrotime() -
trunk/includes/global_function.php
r460 r462 536 536 } 537 537 538 function LogRefer al()538 function LogReferrer() 539 539 { 540 540 global $System; 541 541 542 if(array_key_exists('HTTP_REFERER', $_SERVER)) $Referer = addslashes($_SERVER['HTTP_REFERER']); 543 else $Referer = ''; 544 $Referer = substr($Referer, strpos($Referer, '/') + 2); 545 $HostName = substr($Referer, 0, strpos($Referer, '/')); 546 if(substr($HostName, -1) == '.') $HostName = substr($HostName, 0, -1); 547 //if($HostName != gethostbyname($HostName)) 548 { 549 $Referer = 'http://'.$HostName.'/'; 550 $System->Database->query('REPLACE INTO `Referal` (`Web`, `DateFirst`, `DateLast`, `LastURL`) VALUES ("'.$Referer.'", NOW(), NOW( ), "'.addslashes($_SERVER['HTTP_REFERER']).'")'); 542 if(array_key_exists('HTTP_REFERER', $_SERVER)) 543 { 544 $Referrer = addslashes($_SERVER['HTTP_REFERER']); 545 $HostName = substr($Referrer, strpos($Referrer, '/') + 2); 546 $HostName = substr($HostName, 0, strpos($HostName, '/')); 547 if($HostName != $System->Config['Web']['Host']) 548 { 549 $DbResult = $System->Database->query('SELECT `Id` FROM `Referrer` WHERE `Web` = "'.$HostName.'"'); 550 if($DbResult->num_rows > 0) 551 { 552 $DbRow = $DbResult->fetch_assoc(); 553 $System->Database->query('UPDATE `Referrer` SET `DateLast` = NOW(), `LastURL` = "'.addslashes($Referrer).'" WHERE `Id` = '.$DbRow['Id']); 554 } else $System->Database->query('INSERT INTO `Referrer` (`Web`, `DateFirst`, `DateLast`, `LastURL`) VALUES ("'.$HostName.'", NOW(), NOW( ), "'.addslashes($Referrer).'")'); 555 } 551 556 } 552 557 }
Note:
See TracChangeset
for help on using the changeset viewer.