Skip to content

Commit e6b9d15

Browse files
authored
Merge pull request #220 from donker/sept2025
Fixes
2 parents 0494231 + a171547 commit e6b9d15

22 files changed

+1184
-1136
lines changed

Server/Blog/Admin.ascx

Lines changed: 242 additions & 241 deletions
Large diffs are not rendered by default.

Server/Blog/Admin.ascx.vb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ Public Class Admin
6161

6262
Private Sub cmdCreateVocabulary_Click(sender As Object, e As EventArgs) Handles cmdCreateVocabulary.Click
6363
Settings.VocabularyId = Core.Integration.Integration.CreateNewVocabulary(PortalId).VocabularyId
64-
Settings.UpdateSettings()
64+
Settings.SaveSettings()
6565
DataBind()
6666
End Sub
6767

6868
Private Sub ddVocabularyId_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddVocabularyId.SelectedIndexChanged
6969
Settings.VocabularyId = ddVocabularyId.SelectedValue.ToInt
70-
Settings.UpdateSettings()
70+
Settings.SaveSettings()
7171
DataBind()
7272
End Sub
7373

@@ -103,7 +103,7 @@ Public Class Admin
103103
Settings.RssTtl = Integer.Parse(txtRssTtl.Text)
104104
Settings.IncrementViewCount = Integer.Parse(txtIncrementViewCount.Text)
105105

106-
Settings.UpdateSettings()
106+
Settings.SaveSettings()
107107
If treeState.Value <> TermsController.GetCategoryTreeAsJson(Categories) Then
108108
Dim categoryTree As List(Of DynatreeItem) = Newtonsoft.Json.JsonConvert.DeserializeObject(Of List(Of DynatreeItem))(treeState.Value)
109109
Dim ReturnedIds As New List(Of Integer)

Server/Blog/Blog.ascx.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Public Class Blog
6363
' we have a style detection post in storage and it's being requested
6464
Dim url As String = Settings.StyleDetectionUrl
6565
Settings.StyleDetectionUrl = ""
66-
Settings.UpdateSettings()
66+
Settings.SaveSettings()
6767
Response.Redirect(url, False)
6868
End If
6969

Server/Blog/Components/Api/BlogRouteMapper.vb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Namespace Api
99
Comments
1010
Posts
1111
Terms
12+
Rss
1213
End Enum
1314

1415
Public Const ServicePath As String = "~/DesktopModules/Blog/API/"
@@ -25,6 +26,8 @@ Namespace Api
2526
Return GetRoute("Comments", method)
2627
Case ServiceControllers.Posts
2728
Return GetRoute("Posts", method)
29+
Case ServiceControllers.Rss
30+
Return GetRoute("Rss", method)
2831
Case Else
2932
Return GetRoute("Terms", method)
3033
End Select

Server/Blog/Components/Api/BlogsController.vb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Namespace Api
4848

4949
#Region " Service Methods "
5050
<HttpPost()>
51-
<BlogAuthorizeAttribute(SecurityAccessLevel.Owner Or SecurityAccessLevel.Admin)>
51+
<BlogAuthorize(SecurityAccessLevel.Owner Or SecurityAccessLevel.Admin)>
5252
<ValidateAntiForgeryToken()>
5353
<ActionName("Export")>
5454
Public Function ExportBlog(postData As BlogDTO) As HttpResponseMessage
@@ -61,8 +61,10 @@ Namespace Api
6161
Dim newBlogML As New BlogMLBlog
6262
newBlogML.Title = Blog.Title
6363
newBlogML.SubTitle = Blog.Description
64-
newBlogML.Authors.Add(New BlogMLAuthor With {.Title = Blog.DisplayName})
6564
newBlogML.DateCreated = Blog.CreatedOnDate
65+
For Each author As PostAuthor In Core.Entities.Posts.PostsController.GetAuthors(Settings.ModuleId, Blog.BlogID)
66+
newBlogML.Authors.Add(New BlogMLAuthor With {.Title = author.DisplayName, .ID = author.UserID.ToString, .Email = author.Email})
67+
Next
6668
AddCategories(newBlogML)
6769
AddPosts(newBlogML)
6870
Dim blogMLFile As String = Date.Now.ToString("yyyy-MM-dd") & "-" & Guid.NewGuid.ToString("D")
@@ -82,7 +84,7 @@ Namespace Api
8284
#Region " Private Methods "
8385
Private Sub SetContext(data As BlogDTO)
8486
Blog = Core.Entities.Blogs.BlogsController.GetBlog(data.BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
85-
Settings = ModuleSettings.GetModuleSettings(ActiveModule.ModuleID)
87+
Settings = ModuleSettings.GetSettings(ActiveModule)
8688
End Sub
8789

8890
Private Sub AddCategories(ByRef TargetBlogML As BlogMLBlog)
@@ -122,7 +124,7 @@ Namespace Api
122124
For Each t As TermInfo In post.PostCategories
123125
newPostML.Categories.Add(New BlogMLCategoryReference With {.Ref = t.TermId.ToString})
124126
Next
125-
newPostML.Authors.Add(post.DisplayName)
127+
newPostML.Authors.Add(post.CreatedByUserID.ToString())
126128
newPostML.PostType = BlogML.BlogPostTypes.Normal
127129
newPostML.DateCreated = post.PublishedOnDate
128130
If Not String.IsNullOrEmpty(post.Summary) Then
@@ -142,6 +144,7 @@ Namespace Api
142144
newPostML.DisplayCopyright = post.DisplayCopyright
143145
newPostML.Copyright = post.Copyright
144146
newPostML.Locale = post.Locale
147+
newPostML.IsPublished = post.Published
145148

146149
' pack files
147150
Dim postDir As String = Globals.GetPostDirectoryMapPath(post.BlogID, post.ContentItemId)

Server/Blog/Components/Api/CommentsController.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Namespace Api
6262
Private Property Settings() As ModuleSettings
6363
Get
6464
If _Settings Is Nothing Then
65-
_Settings = ModuleSettings.GetModuleSettings(ActiveModule.ModuleID)
65+
_Settings = ModuleSettings.GetSettings(ActiveModule)
6666
End If
6767
Return _Settings
6868
End Get
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
'
2+
' DNN Connect - http://dnn-connect.org
3+
' Copyright (c) 2015
4+
' by DNN Connect
5+
'
6+
' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
7+
' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
8+
' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
9+
' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10+
'
11+
' The above copyright notice and this permission notice shall be included in all copies or substantial portions
12+
' of the Software.
13+
'
14+
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
15+
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16+
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
17+
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18+
' DEALINGS IN THE SOFTWARE.
19+
'
20+
21+
Imports System.Net
22+
Imports System.Net.Http
23+
Imports System.Web.Http
24+
Imports DotNetNuke.Modules.Blog.Core.Common
25+
Imports DotNetNuke.Modules.Blog.Core.Rss
26+
Imports DotNetNuke.Web.Api
27+
28+
Namespace Api
29+
Public Class RssController
30+
Inherits DnnApiController
31+
32+
<HttpGet()>
33+
<DnnModuleAuthorize(AccessLevel:=DotNetNuke.Security.SecurityAccessLevel.View)>
34+
<ActionName("Get")>
35+
Public Function GetRss() As HttpResponseMessage
36+
Dim res As New HttpResponseMessage(HttpStatusCode.OK)
37+
Dim queryString As NameValueCollection = HttpUtility.ParseQueryString(Request.RequestUri.Query)
38+
Dim feed As New BlogRssFeed(ActiveModule.ModuleID, queryString)
39+
res.Content = New StringContent(Globals.ReadFile(feed.CacheFile), Encoding.UTF8, "application/xml")
40+
Return res
41+
End Function
42+
43+
End Class
44+
End Namespace

Server/Blog/Controls/CategorySelect.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Namespace Controls
6363

6464
Private Sub CategorySelect_Load(sender As Object, e As EventArgs) Handles Me.Load
6565

66-
Dim modVersion As String = ModuleSettings.GetModuleSettings(ModuleConfiguration.ModuleID).Version
66+
Dim modVersion As String = ModuleSettings.GetSettings(ModuleConfiguration).Version
6767
Page.AddJavascriptFile(modVersion, "jquery.dynatree.min.js", "jquery.dynatree", "1.2.4", 60)
6868
Page.AddCssFile(modVersion, "dynatree.css", "dynatree", "1.2.4")
6969
MainControlId = ClientID & "_CategorySelect"

Server/Blog/Controls/ViewSettings.ascx.vb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Namespace Controls
5353
Else
5454
BlogModuleId = ModuleId
5555
End If
56-
ctlCategories.VocabularyId = Core.Common.ModuleSettings.GetModuleSettings(BlogModuleId).VocabularyId
56+
ctlCategories.VocabularyId = Core.Common.ModuleSettings.GetSettings(BlogModuleId).VocabularyId
5757
End If
5858
Catch ex As Exception
5959
End Try
@@ -64,7 +64,7 @@ Namespace Controls
6464

6565
Private Sub ddBlogModuleId_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddBlogModuleId.SelectedIndexChanged
6666
BlogModuleId = CInt(ddBlogModuleId.SelectedValue)
67-
ctlCategories.VocabularyId = Core.Common.ModuleSettings.GetModuleSettings(BlogModuleId).VocabularyId
67+
ctlCategories.VocabularyId = Core.Common.ModuleSettings.GetSettings(BlogModuleId).VocabularyId
6868
LoadDropdowns()
6969
End Sub
7070
#End Region
@@ -96,7 +96,7 @@ Namespace Controls
9696
ddTemplate.Items.Add(New ListItem(d.Name & " [System]", "[G]" & d.Name))
9797
End If
9898
Next
99-
For Each d As IO.DirectoryInfo In (New IO.DirectoryInfo(Core.Common.ModuleSettings.GetModuleSettings(BlogModuleId).PortalTemplatesMapPath)).GetDirectories
99+
For Each d As IO.DirectoryInfo In (New IO.DirectoryInfo(Core.Common.ModuleSettings.GetSettings(BlogModuleId).PortalTemplatesMapPath)).GetDirectories
100100
ddTemplate.Items.Add(New ListItem(d.Name & " [Local]", "[P]" & d.Name))
101101
Next
102102
Dim skinTemplatePath As String = Server.MapPath(DotNetNuke.UI.Skins.Skin.GetSkin(CType(Page, Framework.PageBase)).SkinPath) & "Templates\Blog\"

Server/Blog/DotNetNuke.Modules.Blog.vbproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@
301301
<Compile Include="Components\Api\CommentsController.vb" />
302302
<Compile Include="Components\Api\NotificationServiceController.vb" />
303303
<Compile Include="Components\Api\PostsController.vb" />
304+
<Compile Include="Components\Api\RssController.vb" />
304305
<Compile Include="Components\Api\TermsController.vb" />
305306
<Compile Include="Components\Common\Extensions.vb" />
306307
<Compile Include="Components\Common\Globals.vb" />

0 commit comments

Comments
 (0)