@@ -22,13 +22,17 @@ namespace DotNetNuke.Modules.ActiveForums.Controls
2222{
2323 using System ;
2424 using System . Collections ;
25+ using System . Collections . Generic ;
2526 using System . ComponentModel ;
2627 using System . Text ;
2728 using System . Text . RegularExpressions ;
2829 using System . Web ;
2930 using System . Web . UI ;
3031
3132 using DotNetNuke . Entities . Portals ;
33+ using DotNetNuke . Modules . ActiveForums . Data ;
34+
35+ using Newtonsoft . Json . Bson ;
3236
3337 [ DefaultProperty ( "Text" ) , ToolboxData ( "<{0}:WhatsNewRSS runat=server></{0}:WhatsNewRSS>" ) ]
3438 public class WhatsNewRSS : Control
@@ -250,8 +254,8 @@ private string BuildRSS()
250254 // build items
251255 var forumids = this . Settings . RSSIgnoreSecurity ? this . Settings . Forums : this . AuthorizedForums ;
252256
253- var dr = DataProvider . Instance ( ) . GetPosts ( this . PortalId , forumids , true , false , this . Settings . Rows , this . Settings . Tags ) ;
254257 var sHost = Utilities . GetHost ( ) ;
258+ var dr = DataProvider . Instance ( ) . GetPosts ( forums : forumids , topicsOnly : true , randomOrder : false , rows : this . Settings . Rows , tags : this . Settings . Tags ) ;
255259
256260 try
257261 {
@@ -287,16 +291,14 @@ private string BuildRSS()
287291 lastBuildDate = dateCreated ;
288292 }
289293
290- var ts = SettingsBase . GetModuleSettings ( topicModuleId ) ;
291-
292294 string url ;
293295 if ( string . IsNullOrEmpty ( sTopicUrl ) || ! Utilities . UseFriendlyURLs ( topicModuleId ) )
294296 {
295297 string [ ] @params = { ParamKeys . ViewType + "=" + Views . Topic , ParamKeys . ForumId + "=" + forumId , ParamKeys . TopicId + "=" + topicId } ;
296298 url = Utilities . NavigateURL ( topicTabId , string . Empty , @params ) ;
297299 if ( url . IndexOf ( HttpContext . Current . Request . Url . Host , StringComparison . CurrentCulture ) == - 1 )
298300 {
299- url = Common . Globals . AddHTTP ( HttpContext . Current . Request . Url . Host ) + url ;
301+ url = DotNetNuke . Common . Globals . AddHTTP ( HttpContext . Current . Request . Url . Host ) + url ;
300302 }
301303 }
302304 else
@@ -324,7 +326,7 @@ private string BuildRSS()
324326 // Legacy Attachment functionality uses "attachid"
325327 if ( bodyHtml . Contains ( "[IMAGE:" ) )
326328 {
327- var strHost = Common . Globals . AddHTTP ( Common . Globals . GetDomainName ( HttpContext . Current . Request ) ) + "/" ;
329+ var strHost = DotNetNuke . Common . Globals . AddHTTP ( DotNetNuke . Common . Globals . GetDomainName ( HttpContext . Current . Request ) ) + "/" ;
328330 const string pattern = "([IMAGE:(.+?)])" ;
329331 foreach ( Match match in DotNetNuke . Common . Utilities . RegexUtils . GetCachedRegex ( pattern ) . Matches ( bodyHtml ) )
330332 {
@@ -336,7 +338,7 @@ private string BuildRSS()
336338 // Legacy Attachment functionality uses "attachid"
337339 if ( bodyHtml . Contains ( "[THUMBNAIL:" ) )
338340 {
339- var strHost = Common . Globals . AddHTTP ( Common . Globals . GetDomainName ( HttpContext . Current . Request ) ) + "/" ;
341+ var strHost = DotNetNuke . Common . Globals . AddHTTP ( DotNetNuke . Common . Globals . GetDomainName ( HttpContext . Current . Request ) ) + "/" ;
340342 const string pattern = "([THUMBNAIL:(.+?)])" ;
341343 foreach ( Match match in DotNetNuke . Common . Utilities . RegexUtils . GetCachedRegex ( pattern ) . Matches ( bodyHtml ) )
342344 {
@@ -347,8 +349,8 @@ private string BuildRSS()
347349 }
348350 }
349351
350- bodyHtml = bodyHtml . Replace ( "src=\" /Portals" , "src=\" " + Common . Globals . AddHTTP ( HttpContext . Current . Request . Url . Host ) + "/Portals" ) ;
351- bodyHtml = Utilities . ManageImagePath ( bodyHtml , new Uri ( Common . Globals . AddHTTP ( HttpContext . Current . Request . Url . Host ) ) ) ;
352+ bodyHtml = bodyHtml . Replace ( "src=\" /Portals" , "src=\" " + DotNetNuke . Common . Globals . AddHTTP ( HttpContext . Current . Request . Url . Host ) + "/Portals" ) ;
353+ bodyHtml = Utilities . ManageImagePath ( bodyHtml , new Uri ( DotNetNuke . Common . Globals . AddHTTP ( HttpContext . Current . Request . Url . Host ) ) ) ;
352354
353355 sb . Append ( WriteElement ( "description" , bodyHtml , indent + 1 ) ) ;
354356 }
0 commit comments