Changeset 460 for trunk/includes
- Timestamp:
- Apr 13, 2010, 5:22:25 PM (15 years ago)
- Location:
- trunk/includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/FileStream.php
r447 r460 74 74 } 75 75 76 public function ReadString() 76 public function ReadLine() 77 { 78 return(fgets($this->Handle)); 79 } 80 81 public function ReadTextLine() 77 82 { 78 83 return(fgets($this->Handle)); … … 111 116 public function WriteString($Value) 112 117 { 113 fwrite($this->Handle, $Value."\0"); 118 fwrite($this->Handle, $Value); 119 } 120 121 public function WriteLine($Value) 122 { 123 fputs($this->Handle, $Value); 114 124 } 115 125 -
trunk/includes/MemoryStream.php
r447 r460 58 58 } 59 59 60 public function Read String()60 public function ReadLine($EndSymbol = "\r") 61 61 { 62 62 $Length = 0; … … 65 65 { 66 66 $Char = $this->ReadChar(); 67 if($Char == "\0") break;67 if($Char == $EndSymbol) break; 68 68 } 69 69 $Result = substr($this->Data, $StartPosition, $this->Position - $StartPosition); … … 104 104 } 105 105 106 public function Write String($Value)106 public function WriteLine($Value) 107 107 { 108 $this->WriteBlock($Value."\ 0", strlen($Value) + 1);108 $this->WriteBlock($Value."\r\n", strlen($Value) + 2); 109 109 } 110 110 -
trunk/includes/global.php
r455 r460 29 29 $TranslationTree = GetTranslationTree(); 30 30 $LanguageList = GetLanguageList(); 31 32 LogReferal(); 31 33 32 34 function GetMicrotime() -
trunk/includes/global_function.php
r455 r460 536 536 } 537 537 538 function LogReferal() 539 { 540 global $System; 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']).'")'); 551 } 552 } 553 538 554 ?>
Note:
See TracChangeset
for help on using the changeset viewer.