Changeset 138 for trunk/Modules/News/UNews.pas
- Timestamp:
- Sep 9, 2022, 8:20:25 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/UNews.pas
r137 r138 97 97 DbRows := TDbRows.Create; 98 98 Database.Select(DbRows, 'NewsCategory', '*', 'Id=' + IntToStr(Category)); 99 Output := '<div class="NewsPanel"><div class="Title">' + DbRows[0]. Values['Caption'];99 Output := '<div class="NewsPanel"><div class="Title">' + DbRows[0].Items['Caption']; 100 100 Output := Output + '<div class="Action"><a href="aktuality/index.php?category=' + IntToStr(Category) + '">Zobrazit</a>'; 101 101 if ModuleUser.User.CheckPermission('News', 'Insert', 'Group', Category) then … … 113 113 Output := Output + '<table class="NewsTable">'; 114 114 for I := 0 to DbRows.Count - 1 do begin 115 if DbRows[I]. Values['Name'] = '' then Author := DbRows[I].Values['Author']116 else Author := DbRows[I]. Values['Name'];115 if DbRows[I].Items['Name'] = '' then Author := DbRows[I].Items['Author'] 116 else Author := DbRows[I].Items['Name']; 117 117 Output := Output + '<tr><td onclick="window.location=''aktuality/index.php?action=view&id=' + 118 DbRows[I].Values['Id'] + '''" onmouseover="zobraz(' + '''new' + IntToStr(Category) + 119 IntToStr(Index) + ''')" style="cursor: pointer; margin: 0px;"><table class="NewsItemFrame"><tr><td style="font-size: ' + IntToStr(FontSize) + 'pt"><strong>' + DbRows[I].Values['Title'] + 118 DbRows[I].Items['Id'] + '''" onmouseover="zobraz(' + '''new' + IntToStr(Category) + 119 IntToStr(Index) + ''')" style="cursor: pointer; margin: 0px;"><table class="NewsItemFrame"><tr><td style="font-size: ' + 120 IntToStr(FontSize) + 'pt"><strong>' + DbRows[I].Items['Title'] + 120 121 '</strong></td><td align="right" style="font-size: ' + IntToStr(FontSize) + 'pt">' + 121 Author + ' (' + HumanDate(SQLToDateTime(DbRows[I]. Values['Date'])) + ')</td></tr></table>';122 Output := Output + '<div id="new' + IntToStr(Category) + IntToStr(Index) + '" class="NewsTableItem">' + ModifyContent(DbRows[I]. Values['Content']);123 if DbRows[I]. Values['Link'] <> '' then Output := Output + '<br/><a href="' + DbRows[I].Values['Link'] + '">Odkaz</a>';124 125 if DbRows[I]. Values['Enclosure'] <> '' then begin122 Author + ' (' + HumanDate(SQLToDateTime(DbRows[I].Items['Date'])) + ')</td></tr></table>'; 123 Output := Output + '<div id="new' + IntToStr(Category) + IntToStr(Index) + '" class="NewsTableItem">' + ModifyContent(DbRows[I].Items['Content']); 124 if DbRows[I].Items['Link'] <> '' then Output := Output + '<br/><a href="' + DbRows[I].Items['Link'] + '">Odkaz</a>'; 125 126 if DbRows[I].Items['Enclosure'] <> '' then begin 126 127 Output := Output + '<br />Přílohy: '; 127 Enclosures := Explode(';', DbRows[I]. Values['Enclosure']);128 Enclosures := Explode(';', DbRows[I].Items['Enclosure']); 128 129 for J := 0 to Length(Enclosures) - 1 do begin 129 130 if FileExists(UploadedFilesFolder + Enclosures[J]) then … … 173 174 NewSetting := TNewsSettingItem.Create; 174 175 with NewSetting do begin 175 CategoryId := StrToInt(DbRows[I]. Values['Id']);176 CategoryId := StrToInt(DbRows[I].Items['Id']); 176 177 Index := I; 177 178 Enabled := True; 178 179 ItemCount := 6; // System->Config['Web']['News']['Count'] 179 180 DaysAgo := 30; // System->Config['Web']['News']['DaysAgo'] 180 Group := StrToInt(DbRows[I]. Values['Group']);181 Group := StrToInt(DbRows[I].Items['Group']); 181 182 end; 182 183 Settings.Add(NewSetting); … … 205 206 Column: Integer; 206 207 I: Integer; 208 Action: string; 207 209 begin 208 210 Output := ''; … … 211 213 LoadSettingsFromCookies; 212 214 213 if HandlerData.Request.Query. SearchKey('Action') <> -1then begin215 if HandlerData.Request.Query.TryGetValue('Action', Action) then begin 214 216 // Show news customize menu 215 if HandlerData.Request.Query.Values['Action']= 'CustomizeNews' then begin217 if Action = 'CustomizeNews' then begin 216 218 Output := Output + ShowCustomizeMenu; 217 219 end; … … 251 253 with TNewsSettingItem(Settings[I]) do begin 252 254 Database.Select(DbRows, 'NewsCategory', '*', 'Id=' + IntToStr(CategoryId)); 253 Output := Output + '<tr><td>' + DbRows[0]. Values['Caption'] +255 Output := Output + '<tr><td>' + DbRows[0].Items['Caption'] + 254 256 '</td><td align="center"><input type="text" size="2" name="NewsCategoryIndex' + 255 257 IntToStr(I) + '" value="' + IntToStr(Index) + '" /></td><td align="center"><input type="checkbox" name="NewsCategoryEnabled' + IntToStr(I) + '"';
Note:
See TracChangeset
for help on using the changeset viewer.