Changeset 887 for trunk/Modules/News/NewsSource.php
- Timestamp:
- Nov 20, 2020, 12:08:12 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/NewsSource.php
r878 r887 1 1 <?php 2 2 3 function GetTextBetween( &$Text, $Start, $End)3 function GetTextBetween(string &$Text, string $Start, string $End): string 4 4 { 5 5 $Result = ''; … … 34 34 } 35 35 36 function HumanDateTimeToTime( $DateTime)36 function HumanDateTimeToTime(string $DateTime): int 37 37 { 38 38 if ($DateTime == '') return NULL; … … 49 49 } 50 50 51 function HumanDateToTime( $Date)51 function HumanDateToTime(string $Date): int 52 52 { 53 53 if ($Date == '') return NULL; … … 55 55 } 56 56 57 function GetUrlBase( $Url)57 function GetUrlBase(string $Url): string 58 58 { 59 59 $Result = parse_url($Url); … … 63 63 class NewsSources 64 64 { 65 public $Database;65 public Database $Database; 66 66 67 67 function Parse($Id = null) … … 94 94 class NewsSource 95 95 { 96 public $Name;97 public $URL;96 public string $Name; 97 public string $URL; 98 98 public $Method; 99 public $Id;100 public $Database;101 public $NewsItems;102 public $AddedCount;99 public int $Id; 100 public Database $Database; 101 public array $NewsItems; 102 public int $AddedCount; 103 103 public $Category; 104 104 … … 109 109 } 110 110 111 function Import() 111 function Import(): string 112 112 { 113 113 return ''; 114 114 } 115 115 116 function DoImport() 116 function DoImport(): string 117 117 { 118 118 $this->NewsItems = array(); … … 133 133 class NewsItem 134 134 { 135 var$Database;136 var$Title = '';137 var$Content = '';138 var $Date = '';139 var$Link = '';140 var$Category = '';141 var$Author = '';142 var$IP = '';143 var$Enclosure = '';135 public Database $Database; 136 public string $Title = ''; 137 public string $Content = ''; 138 public int $Date = 0; 139 public string $Link = ''; 140 public string $Category = ''; 141 public string $Author = ''; 142 public string $IP = ''; 143 public string $Enclosure = ''; 144 144 145 function AddIfNotExist() 145 function AddIfNotExist(): int 146 146 { 147 147 $Where = '(`Title` = "'.$this->Database->real_escape_string($this->Title).'") AND '.
Note:
See TracChangeset
for help on using the changeset viewer.