Changeset 137 for trunk/Modules/News/UNews.pas
- Timestamp:
- Sep 9, 2022, 1:16:58 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/UNews.pas
r132 r137 1 1 unit UNews; 2 2 3 {mode delphi}4 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, USqlDatabase, UModuleUser, UUtils, fgl, UWebSession,9 UHTTPServer, UModuleBase, SpecializedList;6 Classes, SysUtils, USqlDatabase, UModuleUser, UUtils, Generics.Collections, UWebSession, 7 UHTTPServer, UModuleBase, UCommon; 10 8 11 9 type … … 19 17 end; 20 18 21 TNewsSettingItems = class(T FPGObjectList<TNewsSettingItem>)19 TNewsSettingItems = class(TObjectList<TNewsSettingItem>) 22 20 end; 23 21 … … 44 42 45 43 46 47 44 implementation 48 45 … … 91 88 J: Integer; 92 89 Author: string; 93 Enclosures: T ListString;90 Enclosures: TStringArray; 94 91 begin 95 92 //global Database, NewsCategoryNames, NewsCountPerCategory, UploadedFilesFolder; … … 128 125 if DbRows[I].Values['Enclosure'] <> '' then begin 129 126 Output := Output + '<br />Přílohy: '; 130 try 131 Enclosures := TListString.Create; 132 Enclosures.Explode(DbRows[I].Values['Enclosure'], ';', StrToStr); 133 for J := 0 to Enclosures.Count - 1 do begin 134 if FileExists(UploadedFilesFolder + Enclosures[J]) then 135 Output := Output + ' <a href="' + UploadedFilesFolder + Enclosures[J] + 136 '">' + Enclosures[J] + '</a>'; 137 end; 138 finally 139 Enclosures.Free; 127 Enclosures := Explode(';', DbRows[I].Values['Enclosure']); 128 for J := 0 to Length(Enclosures) - 1 do begin 129 if FileExists(UploadedFilesFolder + Enclosures[J]) then 130 Output := Output + ' <a href="' + UploadedFilesFolder + Enclosures[J] + 131 '">' + Enclosures[J] + '</a>'; 140 132 end; 141 133 end;
Note:
See TracChangeset
for help on using the changeset viewer.