@@ -531,7 +531,7 @@ private void PrepareReply()
531
531
this . ctlForm . EditorMode = Modules . ActiveForums . Controls . SubmitForm . EditorModes . Reply ;
532
532
533
533
string template = TemplateCache . GetCachedTemplate ( this . ForumModuleId , "ReplyEditor" , this . ForumInfo . FeatureSettings . ReplyFormId ) ;
534
-
534
+
535
535
#region "Backward compatilbility -- remove in v10.00.00"
536
536
template = DotNetNuke . Modules . ActiveForums . Services . Tokens . TokenReplacer . MapLegacyAuthorTokenSynonyms ( new StringBuilder ( template ) , this . PortalSettings , this . MainSettings , this . ForumUser . UserInfo ? . Profile ? . PreferredLocale ) . ToString ( ) ;
537
537
template = DotNetNuke . Modules . ActiveForums . Services . Tokens . TokenReplacer . MapLegacyPostTokenSynonyms ( new StringBuilder ( template ) , this . PortalSettings , this . ForumUser . UserInfo ? . Profile ? . PreferredLocale ) . ToString ( ) ;
@@ -569,11 +569,10 @@ private void PrepareReply()
569
569
this . Response . Redirect ( this . NavigateUrl ( this . TabId ) , false ) ;
570
570
this . Context . ApplicationInstance . CompleteRequest ( ) ;
571
571
}
572
- else
573
- {
574
- this . ctlForm . Subject = Utilities . GetSharedResource ( "[RESX:SubjectPrefix]" ) + " " + System . Net . WebUtility . HtmlDecode ( ti . Content . Subject ) ;
575
- this . ctlForm . TopicSubject = System . Net . WebUtility . HtmlDecode ( ti . Content . Subject ) ;
576
- var body = string . Empty ;
572
+
573
+ this . ctlForm . Subject = Utilities . GetSharedResource ( "[RESX:SubjectPrefix]" ) + " " + System . Net . WebUtility . HtmlDecode ( ti . Content . Subject ) ;
574
+ this . ctlForm . TopicSubject = System . Net . WebUtility . HtmlDecode ( ti . Content . Subject ) ;
575
+ var body = string . Empty ;
577
576
578
577
if ( ti . IsLocked && ( this . ForumUser . CurrentUserType == CurrentUserTypes . Anon || this . ForumUser . CurrentUserType == CurrentUserTypes . Auth ) )
579
578
{
@@ -586,7 +585,6 @@ private void PrepareReply()
586
585
// Setup form for Quote or Reply with body display
587
586
var isQuote = false ;
588
587
var postId = 0 ;
589
- var sPostedBy = Utilities . GetSharedResource ( "[RESX:PostedBy]" ) + " {0} {1} {2}" ;
590
588
if ( this . Request . Params [ ParamKeys . QuoteId ] != null )
591
589
{
592
590
isQuote = true ;
@@ -610,19 +608,17 @@ private void PrepareReply()
610
608
}
611
609
}
612
610
613
- if ( postId != 0 )
614
- {
615
- var post = postId == this . TopicId ? ti : ( DotNetNuke . Modules . ActiveForums . Entities . IPostInfo ) new DotNetNuke . Modules . ActiveForums . Controllers . ReplyController ( this . ForumModuleId ) . GetById ( postId ) ;
616
- if ( post != null )
617
- {
618
- sPostedBy = string . Format ( sPostedBy , DotNetNuke . Modules . ActiveForums . Controllers . ForumUserController . GetDisplayName ( this . PortalSettings , this . MainSettings , false , false , post . Author . AuthorId , post . Author . Username , post . Author . FirstName , post . Author . LastName , post . Author . DisplayName ) , Utilities . GetSharedResource ( "On.Text" ) , Utilities . GetUserFormattedDateTime ( post . Content . DateCreated , this . PortalId , this . UserId ) ) ;
619
- body = post . Content . Body ;
620
- }
621
- }
622
-
611
+ if ( postId != 0 )
612
+ {
613
+ var post = postId == this . TopicId ? ti : ( DotNetNuke . Modules . ActiveForums . Entities . IPostInfo ) new DotNetNuke . Modules . ActiveForums . Controllers . ReplyController ( this . ForumModuleId ) . GetById ( postId ) ;
614
+ if ( post != null )
615
+ {
616
+ var sPostedBy = Utilities . GetSharedResource ( "[RESX:PostedBy]" ) + " {0} {1} {2}" ;
617
+ sPostedBy = string . Format ( sPostedBy , DotNetNuke . Modules . ActiveForums . Controllers . ForumUserController . GetDisplayName ( this . PortalSettings , this . MainSettings , false , false , post . Author . AuthorId , post . Author . Username , post . Author . FirstName , post . Author . LastName , post . Author . DisplayName ) , Utilities . GetSharedResource ( "On.Text" ) , Utilities . GetUserFormattedDateTime ( post . Content . DateCreated , this . PortalId , this . UserId ) ) ;
618
+ body = post . Content . Body ;
623
619
if ( this . allowHTML && this . editorType != EditorTypes . TEXTBOX )
624
620
{
625
- if ( body . ToUpper ( ) . Contains ( "<CODE" ) | body . ToUpper ( ) . Contains ( "[CODE]" ) )
621
+ if ( body . ToUpperInvariant ( ) . Contains ( "<CODE" ) || body . ToUpperInvariant ( ) . Contains ( "[CODE]" ) )
626
622
{
627
623
body = CodeParser . ParseCode ( System . Net . WebUtility . HtmlDecode ( body ) ) ;
628
624
}
@@ -651,12 +647,22 @@ private void PrepareReply()
651
647
}
652
648
653
649
this . ctlForm . Body = body ;
650
+
651
+ if ( this . ctlForm . EditorMode != SubmitForm . EditorModes . EditReply && this . canModApprove )
652
+ {
653
+ this . ctlForm . ShowModOptions = false ;
654
+ }
655
+ }
656
+ else
657
+ {
658
+ var im = new InfoMessage { Message = this . GetSharedResource ( "[RESX:Message:LoadTopicFailed]" ) } ;
659
+ this . plhContent . Controls . Add ( im ) ;
654
660
}
655
661
}
656
-
657
- if ( this . ctlForm . EditorMode != SubmitForm . EditorModes . EditReply && this . canModApprove )
662
+ else
658
663
{
659
- this . ctlForm . ShowModOptions = false ;
664
+ var im = new InfoMessage { Message = this . GetSharedResource ( "[RESX:Message:LoadTopicFailed]" ) } ;
665
+ this . plhContent . Controls . Add ( im ) ;
660
666
}
661
667
}
662
668
}
0 commit comments