Ignore:
Timestamp:
Sep 9, 2022, 1:16:58 AM (2 years ago)
Author:
chronos
Message:
  • Added: Robots page.
  • Modified: Canonical URL for webcams.
  • Modified: Removed compiler mode delphi as it is already set in project.
  • Modified: Updated Common package.
  • Modified: Use Generics.Collections instead of fgl.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/News/UNews.pas

    r132 r137  
    11unit UNews;
    22
    3 {mode delphi}
    4 
    53interface
    64
    75uses
    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;
    108
    119type
     
    1917  end;
    2018
    21   TNewsSettingItems = class(TFPGObjectList<TNewsSettingItem>)
     19  TNewsSettingItems = class(TObjectList<TNewsSettingItem>)
    2220  end;
    2321
     
    4442
    4543
    46 
    4744implementation
    4845
     
    9188  J: Integer;
    9289  Author: string;
    93   Enclosures: TListString;
     90  Enclosures: TStringArray;
    9491begin
    9592  //global Database, NewsCategoryNames, NewsCountPerCategory, UploadedFilesFolder;
     
    128125      if DbRows[I].Values['Enclosure'] <> '' then begin
    129126        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>';
    140132        end;
    141133      end;
Note: See TracChangeset for help on using the changeset viewer.