Skip to content

Commit 08216a9

Browse files
authored
Merge pull request #1374 from DNNCommunity/dev
Syncing branches
2 parents 641d00d + 4994105 commit 08216a9

File tree

10 files changed

+312
-131
lines changed

10 files changed

+312
-131
lines changed

Dnn.CommunityForums/CustomControls/UserControls/TopicView.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,12 @@ private void LoadData(int pageId)
315315
TopicData = this.drForum["TopicData"].ToString(),
316316
NextTopic = Utilities.SafeConvertInt(this.drForum["NextTopic"]),
317317
PrevTopic = Utilities.SafeConvertInt(this.drForum["PrevTopic"]),
318+
ContentId = Utilities.SafeConvertInt(this.drForum["ContentId"]),
318319
Content = new DotNetNuke.Modules.ActiveForums.Entities.ContentInfo
319320
{
320321
ModuleId = this.ForumModuleId,
322+
ContentId = Utilities.SafeConvertInt(this.drForum["ContentId"]),
323+
IPAddress = this.drForum["IPAddress"].ToString(),
321324
Subject = System.Net.WebUtility.HtmlDecode(this.drForum["Subject"].ToString()),
322325
Summary = System.Net.WebUtility.HtmlDecode(this.drForum["Summary"].ToString()),
323326
Body = System.Net.WebUtility.HtmlDecode(this.drForum["Body"].ToString()),
@@ -347,14 +350,14 @@ private void LoadData(int pageId)
347350

348351
this.topic.Forum = this.ForumInfo;
349352

350-
351353
this.topic.LastReply.Author = new DotNetNuke.Modules.ActiveForums.Entities.AuthorInfo(this.PortalId, this.ForumModuleId, this.topic.LastReply.Content.AuthorId);
352354
this.topic.LastReply.Author.ForumUser.UserInfo.DisplayName = this.drForum["LastPostDisplayName"].ToString();
353355
this.topic.LastReply.Author.ForumUser.UserInfo.FirstName = this.drForum["LastPostFirstName"].ToString();
354356
this.topic.LastReply.Author.ForumUser.UserInfo.LastName = this.drForum["LastPostLastName"].ToString();
355357
this.topic.LastReply.Author.ForumUser.UserInfo.Username = this.drForum["LastPostUserName"].ToString();
356358
this.topic.LastReply.Author.ForumUser.PortalId = this.PortalId;
357359
this.topic.LastReply.Author.ForumUser.ModuleId = this.ForumModuleId;
360+
this.topic.UpdateCache();
358361

359362
this.topicTemplateId = Utilities.SafeConvertInt(this.drForum["TopicTemplateId"]);
360363
this.tags = this.drForum["Tags"].ToString();
@@ -1031,13 +1034,6 @@ private string ParseContent(DataRow dr, string template, int rowcount)
10311034

10321035
bool isReply = !dr.GetInt("ReplyId").Equals(0);
10331036

1034-
// most topic values come in first result set and are set in LoadData(); however some, like IP Address and contentId, comes in this result set.
1035-
if (!isReply)
1036-
{
1037-
this.topic.Content.IPAddress = dr.GetString("IPAddress");
1038-
this.topic.ContentId = dr.GetInt("ContentId");
1039-
this.topic.Content.ContentId = dr.GetInt("ContentId");
1040-
}
10411037

10421038
// Replace Tags Control
10431039
var tags = dr.GetString("Tags");

Dnn.CommunityForums/DnnCommunityForums.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,7 @@
12541254
<None Include="sql\07.00.09.SqlDataProvider" />
12551255
<None Include="sql\07.00.09.SqlDataProvider" />
12561256
<None Include="sql\07.00.10.SqlDataProvider" />
1257+
<None Include="sql\08.02.08.SqlDataProvider" />
12571258
<None Include="sql\08.02.04.SqlDataProvider" />
12581259
<None Include="sql\08.02.03.SqlDataProvider" />
12591260
<None Include="sql\08.02.02.SqlDataProvider" />

Dnn.CommunityForums/DnnCommunityForums.dnn

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<dotnetnuke type="Package" version="5.0">
22
<packages>
3-
<package name="Active Forums" type="Module" version="08.02.07">
3+
<package name="Active Forums" type="Module" version="08.02.08">
44
<friendlyName>DNN Community Forums</friendlyName>
55
<description>DNN Community Forums: The official online forums module for the DNN Community.</description>
66
<iconFile>DesktopModules/ActiveForums/images/branding/logo/DNN-Community-Forums-Icon-64px.png</iconFile>
@@ -75,7 +75,7 @@
7575
<attributes>
7676
<businessControllerClass>DotNetNuke.Modules.ActiveForums.TopicsController, DotNetNuke.Modules.ActiveForums</businessControllerClass>
7777
<desktopModuleID>[DESKTOPMODULEID]</desktopModuleID>
78-
<upgradeVersionsList>07.00.07,07.00.11,07.00.12,08.00.00,08.01.00,08.02.00,08.02.02,08.02.03,08.02.04</upgradeVersionsList>
78+
<upgradeVersionsList>07.00.07,07.00.11,07.00.12,08.00.00,08.01.00,08.02.00,08.02.02,08.02.03,08.02.04,08.02.08</upgradeVersionsList>
7979
</attributes>
8080
</eventMessage>
8181
</component>
@@ -86,7 +86,7 @@
8686
<assembly>
8787
<name>DotNetNuke.Modules.ActiveForums.dll</name>
8888
<sourceFileName>bin\DotNetNuke.Modules.ActiveForums.dll</sourceFileName>
89-
<version>08.02.07</version>
89+
<version>08.02.08</version>
9090
</assembly>
9191
</assemblies>
9292
</component>
@@ -414,10 +414,15 @@
414414
<name>08.02.04.SqlDataProvider</name>
415415
<version>08.02.04</version>
416416
</script>
417+
<script type="Install">
418+
<path>sql</path>
419+
<name>08.02.08.SqlDataProvider</name>
420+
<version>08.02.08</version>
421+
</script>
417422
<script type="UnInstall">
418423
<path>sql</path>
419424
<name>Uninstall.SqlDataProvider</name>
420-
<version>08.02.07</version>
425+
<version>08.02.08</version>
421426
</script>
422427
</scripts>
423428
</component>
@@ -460,7 +465,7 @@
460465
</components>
461466
</package>
462467

463-
<package name="Active Forums What's New" type="Module" version="08.02.07">
468+
<package name="Active Forums What's New" type="Module" version="08.02.08">
464469

465470
<friendlyName>DNN Community Forums What's New</friendlyName>
466471
<foldername>ActiveForumsWhatsNew</foldername>
@@ -530,7 +535,7 @@
530535
</components>
531536
</package>
532537

533-
<package name="Active Forums Viewer" type="Module" version="08.02.07">
538+
<package name="Active Forums Viewer" type="Module" version="08.02.08">
534539
<friendlyName>DNN Community Forums Forums Viewer</friendlyName>
535540
<foldername>ActiveForumsViewer</foldername>
536541
<description>DNN Community Forums: Display any forum topic view on any page within your site.</description>

Dnn.CommunityForums/DnnCommunityForums_Symbols.dnn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<dotnetnuke type="Package" version="5.0">
22
<packages>
3-
<package name="Active Forums_Symbols" type="Library" version="08.02.07">
3+
<package name="Active Forums_Symbols" type="Library" version="08.02.08">
44

55
<friendlyName>DNN Community Forums Symbols</friendlyName>
66
<description>DNN Community Forums: The official online forums module for the DNN Community.</description>
@@ -15,7 +15,7 @@
1515
<releaseNotes src="ReleaseNotes.txt" />
1616
<azureCompatible>True</azureCompatible>
1717
<dependencies>
18-
<dependency type="managedPackage" version="8.2.7">Active Forums</dependency>
18+
<dependency type="managedPackage" version="8.2.8">Active Forums</dependency>
1919
</dependencies>
2020
<components>
2121
<component type="ResourceFile">

Dnn.CommunityForums/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
// You can specify all the values or you can default the Build and Revision Numbers
5353
// by using the '*' as shown below:
5454

55-
[assembly: AssemblyVersion("08.02.07")]
55+
[assembly: AssemblyVersion("08.02.08")]
5656

57-
[assembly: AssemblyFileVersion("08.02.07")]
57+
[assembly: AssemblyFileVersion("08.02.08")]
5858

5959
[assembly: WebResource("DotNetNuke.Modules.ActiveForums.CustomControls.Resources.cb.js", "text/javascript")]
6060
[assembly: WebResource("DotNetNuke.Modules.ActiveForums.scripts.afadmin.properties.js", "text/javascript")]

Dnn.CommunityForums/ReleaseNotes.txt

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@
8989
<hr />
9090

9191
<h3>
92-
08.02.07
92+
08.02.08
9393
</h3>
9494
<p>
9595
<b>THANK YOU</b> for all of the valuable contributions by <a href="https://github.com/johnhenley" target="_blank">@johnhenley</a>,
96-
<a href="https://github.com/Timo-Breumelhof" target="_blank">@Timo-Breumelhof</a>, and
96+
<!--<a href="https://github.com/Timo-Breumelhof" target="_blank">@Timo-Breumelhof</a>, and -->
9797
<a href="https://github.com/WillStrohl" target="_blank">@WillStrohl</a>.
9898
</p>
9999
<p>
@@ -102,9 +102,7 @@
102102

103103
<h4>New Features &amp; Enhancements</h4>
104104
<ul>
105-
<li>UPDATE: Improved the Usability of the Advanced Search View (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1340">Issue 1340</a>)</li>
106-
<li>UPDATE: Improved the Usability of the Pager for Mobile Visitors (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1331">Issue 1331</a>)</li>
107-
<li>UPDATE: Search Pages Now Completely Using Localized Values (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1347">Issue 1347</a>)</li>
105+
<li>None at this time.</li>
108106
<!--
109107
<li>UPDATE: (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/">Issue </a>)</li>
110108
<li>None at this time.</li>
@@ -113,12 +111,8 @@
113111

114112
<h4>Bug Fixes</h4>
115113
<ul>
116-
<li>FIXED: Posts &amp; Reply Display Issues in the Search Results View (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1336">Issue 1336</a>!)</li>
117-
<li>FIXED: Exceptions When Banning a User Account (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1334">Issue 1334</a>!)</li>
118-
<li>FIXED: Intermittent Exception can Happen on Replies (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1333">Issue 1333</a>!)</li>
119-
<li>FIXED: Conflict Between Processing Keystrokes on the Forum Search and Quick Reply (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1360">Issue 1360</a>!)</li>
120-
<li>FIXED: Token Replacement Removing `&lt;br /&gt;` Tags from Content (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1359">Issue 1359</a>!)</li>
121-
<li>FIXED: Extra Empty Rows Displayed in the Filter Results View (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1335">Issue 1335</a>!)</li>
114+
<li>FIXED: Fatal Exception on Attempts to Load the Reply View When There are Unexpected Post Count in the Pager (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1333">Issue 1333</a>!)</li>
115+
<li>FIXED: Topic Edit Preview Not Using Token Replacement (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1369">Issue 1369</a>!)</li>
122116
<!--
123117
<li>FIXED: (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/">Issue </a>!)</li>
124118
<li>None at this time.</li>
@@ -127,11 +121,7 @@
127121

128122
<h4>Tasks / Development Updates (and Technical Debt)</h4>
129123
<ul>
130-
<li>TASK: Use the DNN ClientResourceManagement API Instead of Embedding Resources (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1341">Issue 1341</a>)</li>
131-
<li>TASK: Update URL Construction to Better Handle the Viewer Module (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1343">Issue 1343</a>)</li>
132-
<li>TASK: Removed the Legacy Dependency to `SimulateIsNumeric` (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1309">Issue 1309</a>)</li>
133-
<li>TASK: Removed the Legacy Dependency to `SimulateDateDiff` (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1286">Issue 1286</a>)</li>
134-
<li>Release Prep: 08.02.07 (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1369">Issue 1369</a>)</li>
124+
<li>Release Prep: 08.02.08 (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/1372">Issue 1372</a>)</li>
135125
<!--
136126
<li>TASK: (<a href="https://github.com/DNNCommunity/Dnn.CommunityForums/issues/">Issue </a>)</li>
137127
<li>None at this time.</li>

Dnn.CommunityForums/Services/Tokens/TokenReplacer.cs

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -609,39 +609,54 @@ internal static StringBuilder RemoveControlTokensForDnnPrintMode(StringBuilder t
609609
"[POSTRATINGBUTTON]",
610610
"[JUMPTO]",
611611
"[NEXTTOPIC]",
612-
"[FORUMPOST:NEXTTOPICLINK]",
613-
"[FORUMTOPIC:NEXTTOPICLINK]",
614612
"[PREVTOPIC]",
615-
"[FORUMPOST:PREVIOUSTOPICLINK]",
616-
"[FORUMTOPIC:PREVIOUSTOPICLINK]",
617613
"[AF:CONTROL:STATUS]",
618614
"[ACTIONS:DELETE]",
619-
"[FORUMPOST:ACTIONDELETEONCLICK]",
620-
"[FORUMTOPIC:ACTIONDELETEONCLICK]",
621615
"[ACTIONS:EDIT]",
622-
"[FORUMPOST:ACTIONEDITONCLICK]",
623-
"[FORUMTOPIC:ACTIONEDITONCLICK]",
624616
"[ACTIONS:QUOTE]",
625-
"[FORUMPOST:ACTIONQUOTEONCLICK]",
626-
"[FORUMTOPIC:ACTIONQUOTEONCLICK]",
627617
"[ACTIONS:REPLY]",
628-
"[FORUMPOST:ACTIONREPLYONCLICK]",
629-
"[FORUMTOPIC:ACTIONREPLYONCLICK]",
630618
"[ACTIONS:ANSWER]",
631-
"[FORUMPOST:ACTIONANSWERONCLICK]",
632-
"[FORUMTOPIC:ACTIONANSWERONCLICK]",
633619
"[ACTIONS:ALERT]",
634-
"[FORUMPOST:ACTIONALERTONCLICK]",
635-
"[FORUMTOPIC:ACTIONALERTONCLICK]",
636620
"[ACTIONS:BAN]",
637-
"[FORUMPOST:ACTIONBANONCLICK]",
638-
"[FORUMTOPIC:ACTIONBANONCLICK]",
639621
"[ACTIONS:MOVE]",
640-
"[FORUMPOST:ACTIONMOVEONCLICK]",
641-
"[FORUMTOPIC:ACTIONMOVEONCLICK]",
642622
};
623+
tokens.ToList().ForEach(token => template.Replace(token, string.Empty));
624+
625+
string[] tokenPrefixes =
626+
{
627+
"[FORUMPOST:NEXTTOPICLINK",
628+
"[FORUMTOPIC:NEXTTOPICLINK",
629+
"[FORUMPOST:PREVIOUSTOPICLINK",
630+
"[FORUMTOPIC:PREVIOUSTOPICLINK",
631+
"[FORUMPOST:ACTIONDELETEONCLICK",
632+
"[FORUMTOPIC:ACTIONDELETEONCLICK",
633+
"[FORUMPOST:ACTIONEDITONCLICK",
634+
"[FORUMTOPIC:ACTIONEDITONCLICK",
635+
"[FORUMPOST:ACTIONQUOTEONCLICK",
636+
"[FORUMTOPIC:ACTIONQUOTEONCLICK",
637+
"[FORUMPOST:ACTIONREPLYONCLICK",
638+
"[FORUMTOPIC:ACTIONREPLYONCLICK",
639+
"[FORUMPOST:ACTIONANSWERONCLICK",
640+
"[FORUMTOPIC:ACTIONANSWERONCLICK",
641+
"[FORUMPOST:ACTIONALERTONCLICK",
642+
"[FORUMTOPIC:ACTIONALERTONCLICK",
643+
"[FORUMPOST:ACTIONBANONCLICK",
644+
"[FORUMTOPIC:ACTIONBANONCLICK",
645+
"[FORUMPOST:ACTIONMOVEONCLICK",
646+
"[FORUMTOPIC:ACTIONMOVEONCLICK",
647+
"[FORUMPOST:ACTIONPINONCLICK",
648+
"[FORUMTOPIC:ACTIONPINONCLICK",
649+
"[FORUMPOST:ACTIONUNPINONCLICK",
650+
"[FORUMTOPIC:ACTIONUNPINONCLICK",
651+
"[FORUMPOST:ACTIONLOCKONCLICK",
652+
"[FORUMTOPIC:ACTIONLOCKONCLICK",
653+
"[FORUMPOST:ACTIONUNLOCKONCLICK",
654+
"[FORUMTOPIC:ACTIONUNLOCKONCLICK",
655+
"[FORUMPOST:LIKEONCLICK",
656+
"[FORUMPOST:LIKESLINK",
657+
};
658+
tokenPrefixes.ToList().ForEach(tokenPrefix => template = RemovePrefixedToken(template, tokenPrefix));
643659

644-
tokens.ToList().ForEach(t => template.Replace(t, string.Empty));
645660
return template;
646661
}
647662

Dnn.CommunityForums/class/TemplateUtils.cs

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -529,21 +529,36 @@ internal static string ParseProfile(DotNetNuke.Modules.ActiveForums.Entities.For
529529

530530
#endregion "Deprecated Methods"
531531

532-
internal static string PreviewTopic(int topicTemplateID, DotNetNuke.Modules.ActiveForums.Entities.ForumInfo forumInfo, DotNetNuke.Modules.ActiveForums.Entities.ForumUserInfo user, string body, string imagePath,DateTime postDate, CurrentUserTypes currentUserType, int currentUserId, TimeSpan timeZoneOffset)
532+
internal static string PreviewTopic(int topicTemplateID, DotNetNuke.Modules.ActiveForums.Entities.ForumInfo forumInfo, DotNetNuke.Modules.ActiveForums.Entities.ForumUserInfo user, string body, string imagePath, DateTime postDate, CurrentUserTypes currentUserType, int currentUserId, TimeSpan timeZoneOffset, Uri requestUri, string rawUrl)
533533
{
534534
var sTemplate = TemplateCache.GetCachedTemplate(forumInfo.ModuleId, "TopicView", topicTemplateID);
535535
try
536536
{
537-
var mainSettings = SettingsBase.GetModuleSettings(forumInfo.ModuleId);
538-
var sTopic = GetTemplateSection(sTemplate, "[TOPIC]", "[/TOPIC]");
539-
sTopic = sTopic.Replace("[ACTIONS:ALERT]", string.Empty);
540-
sTopic = sTopic.Replace("[ACTIONS:EDIT]", string.Empty);
541-
sTopic = sTopic.Replace("[ACTIONS:DELETE]", string.Empty);
542-
sTopic = sTopic.Replace("[ACTIONS:QUOTE]", string.Empty);
543-
sTopic = sTopic.Replace("[ACTIONS:REPLY]", string.Empty);
544-
sTopic = sTopic.Replace("[POSTDATE]", Utilities.GetUserFormattedDateTime(postDate, forumInfo.PortalId, user.UserId));
545-
sTopic = sTopic.Replace("[POSTINFO]", GetPostInfo(forumInfo.ModuleId, user, imagePath, false, HttpContext.Current.Request.UserHostAddress, true, currentUserType, currentUserId, false, timeZoneOffset));
546-
sTemplate = ParsePreview(forumInfo.PortalId, sTopic, body, forumInfo.ModuleId);
537+
var sbTopicTemplate = new StringBuilder(GetTemplateSection(sTemplate, "[TOPIC]", "[/TOPIC]"));
538+
sbTopicTemplate = ReplaceSubSection(sbTopicTemplate, string.Empty, "[AF:CONTROL:TAGS]", "[/AF:CONTROL:TAGS]");
539+
540+
#region "Backward compatibility -- remove in v10.00.00"
541+
sbTopicTemplate = DotNetNuke.Modules.ActiveForums.Services.Tokens.TokenReplacer.MapLegacyUserTokenSynonyms(sbTopicTemplate, forumInfo.PortalSettings, forumInfo.MainSettings, user.UserInfo?.Profile?.PreferredLocale);
542+
sbTopicTemplate = DotNetNuke.Modules.ActiveForums.Services.Tokens.TokenReplacer.MapLegacyAuthorTokenSynonyms(sbTopicTemplate, forumInfo.PortalSettings, forumInfo.MainSettings, user.UserInfo?.Profile?.PreferredLocale);
543+
sbTopicTemplate = DotNetNuke.Modules.ActiveForums.Services.Tokens.TokenReplacer.MapLegacyTopicTokenSynonyms(sbTopicTemplate, forumInfo.PortalSettings, user.UserInfo?.Profile?.PreferredLocale);
544+
sbTopicTemplate = DotNetNuke.Modules.ActiveForums.Services.Tokens.TokenReplacer.MapLegacyPostTokenSynonyms(sbTopicTemplate, forumInfo.PortalSettings, user.UserInfo?.Profile?.PreferredLocale);
545+
#endregion "Backward compatibility -- remove in v10.00.00"
546+
547+
sbTopicTemplate = DotNetNuke.Modules.ActiveForums.Services.Tokens.TokenReplacer.RemoveControlTokensForDnnPrintMode(sbTopicTemplate);
548+
549+
var topic = new DotNetNuke.Modules.ActiveForums.Entities.TopicInfo
550+
{
551+
Content = new DotNetNuke.Modules.ActiveForums.Entities.ContentInfo
552+
{
553+
Body = body,
554+
DateCreated = postDate,
555+
DateUpdated = postDate,
556+
},
557+
Author = new DotNetNuke.Modules.ActiveForums.Entities.AuthorInfo(user),
558+
Forum = forumInfo,
559+
};
560+
sbTopicTemplate = DotNetNuke.Modules.ActiveForums.Services.Tokens.TokenReplacer.ReplacePostTokens(sbTopicTemplate, topic, forumInfo.PortalSettings, forumInfo.MainSettings, new Services.URLNavigator().NavigationManager(), user, requestUri, rawUrl);
561+
sTemplate = ParsePreview(forumInfo.PortalId, sbTopicTemplate.ToString(), body, forumInfo.ModuleId);
547562
sTemplate = string.Concat("<table class=\"afgrid\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\" border=\"1\">", sTemplate);
548563
sTemplate = string.Concat(sTemplate, "</table>");
549564
sTemplate = Utilities.LocalizeControl(sTemplate);

0 commit comments

Comments
 (0)