Changeset 953 for trunk/Modules/News/News.php
- Timestamp:
- Aug 11, 2023, 11:17:28 AM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/News.php
r938 r953 16 16 public int $NewsCountPerCategory = 3; 17 17 public string $UploadedFilesFolder = 'files/news/'; 18 public array $NewsSetting; 18 19 19 20 function __construct(System $System) … … 86 87 } 87 88 89 function GetIntranetCondition(): string 90 { 91 if (IsInternetAddr()) return ' AND (`Intranet`=0)'; 92 else return ''; 93 } 94 88 95 function ShowNews(string $Category, int $ItemCount, int $DaysAgo): string 89 96 { … … 97 104 $Output .= ' <a href="aktuality/?action=add&category='.$Category.'">Přidat</a>'; 98 105 $Output .= '</div></div><div class="Content">'; 99 $DbResult = $this->Database->query('SELECT `News`.*, `User`.`Name` FROM `News` LEFT JOIN `User` ON `User`.`Id`=`News`.`User` WHERE (`News`.`Category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `News`.`Date`) ORDER BY `News`.`Date` DESC LIMIT 0,'.$ItemCount); 106 $DbResult = $this->Database->query('SELECT `News`.*, `User`.`Name` FROM `News` LEFT JOIN `User` ON `User`.`Id`=`News`.`User`'. 107 ' WHERE (`News`.`Category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `News`.`Date`)'.$this->GetIntranetCondition(). 108 ' ORDER BY `News`.`Date` DESC LIMIT 0,'.$ItemCount); 100 109 101 110 $Index = 0; … … 162 171 { 163 172 $Output = ''; 164 173 165 174 $this->LoadSettingsFromCookies(); 166 175
Note:
See TracChangeset
for help on using the changeset viewer.