Changeset 137 for trunk/Modules/News
- Timestamp:
- Sep 9, 2022, 1:16:58 AM (2 years ago)
- Location:
- trunk/Modules/News
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/UModuleNews.pas
r107 r137 1 1 unit UModuleNews; 2 3 {$mode delphi}4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, UModularSystem, SpecializedDictionary, UModuleBase, UNews, 9 UHTTPServer, UModuleUser; 6 Classes, SysUtils, UModularSystem, UModuleBase, UNews, UHTTPServer, UModuleUser; 10 7 11 8 type … … 82 79 var 83 80 DbRows: TDbRows; 84 Data: TDictionaryStringString;85 81 begin 86 82 try 87 83 DbRows := TDbRows.Create; 88 Data := TDictionaryStringString.Create;89 84 90 85 Core.CommonDatabase.Query(DbRows, … … 125 120 ' ADD CONSTRAINT `News_ibfk_1` FOREIGN KEY (`Category`) REFERENCES `NewsCategory` (`Id`);'); 126 121 finally 127 Data.Free;128 122 DbRows.Free; 129 123 end; 130 inherited Install;124 inherited; 131 125 end; 132 126 … … 135 129 DbRows: TDbRows; 136 130 begin 137 inherited Uninstall;131 inherited; 138 132 try 139 133 DbRows := TDbRows.Create; -
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.