Esempio n. 1
0
    /// <summary>
    /// Loads the data.
    /// </summary>
    private void LoadData()
    {
        // Get the forum post
        ForumPostInfo fpi = ForumPostInfoProvider.GetForumPostInfo(ValidationHelper.GetInteger(PostID, 0));
        ForumInfo     fi  = null;

        if (fpi != null)
        {
            fi = ForumInfoProvider.GetForumInfo(fpi.PostForumID);
        }
        else
        {
            return;
        }

        if (fi.ForumEnableAdvancedImage)
        {
            ltrText.AllowedControls = ControlsHelper.ALLOWED_FORUM_CONTROLS;
        }
        else
        {
            ltrText.AllowedControls = "none";
        }

        // Display converted datetime for live site
        lblDate.Text = TimeZoneMethods.ConvertDateTime(ValidationHelper.GetDateTime(fpi.PostTime, DateTimeHelper.ZERO_TIME), this).ToString();

        lblUser.Text    = HTMLHelper.HTMLEncode(fpi.PostUserName);
        lblSubject.Text = HTMLHelper.HTMLEncode(fpi.PostSubject);

        DiscussionMacroResolver dmh = new DiscussionMacroResolver();

        dmh.EnableBold          = fi.ForumEnableFontBold;
        dmh.EnableItalics       = fi.ForumEnableFontItalics;
        dmh.EnableStrikeThrough = fi.ForumEnableFontStrike;
        dmh.EnableUnderline     = fi.ForumEnableFontUnderline;
        dmh.EnableCode          = fi.ForumEnableCodeSnippet;
        dmh.EnableColor         = fi.ForumEnableFontColor;
        dmh.EnableImage         = fi.ForumEnableImage || fi.ForumEnableAdvancedImage;
        dmh.EnableQuote         = fi.ForumEnableQuote;
        dmh.EnableURL           = fi.ForumEnableURL || fi.ForumEnableAdvancedURL;
        dmh.MaxImageSideSize    = fi.ForumImageMaxSideSize;
        dmh.QuotePostText       = GetString("DiscussionMacroResolver.QuotePostText");

        if (fi.ForumHTMLEditor)
        {
            dmh.EncodeText = false;
            dmh.ConvertLineBreaksToHTML = false;
        }
        else
        {
            dmh.EncodeText = true;
            dmh.ConvertLineBreaksToHTML = true;
        }

        // Resolve the macros and display the post text
        ltrText.Text = dmh.ResolveMacros(fpi.PostText);
    }
Esempio n. 2
0
    /// <summary>
    /// Prepare the plain text body of the e-mail message for display.
    /// </summary>
    /// <param name="ei">The e-mail message object</param>
    private void LoadPlainTextBody(EmailInfo ei)
    {
        DiscussionMacroResolver dmh = new DiscussionMacroResolver {
            ResolveToPlainText = true
        };
        string body = dmh.ResolveMacros(ei.EmailPlainTextBody);

        body = HTMLHelper.HTMLEncode(body);

        lblBodyValue.Visible = true;

        // Replace line breaks with br tags and modify discussion macros
        lblBodyValue.Text = DiscussionMacroResolver.RemoveTags(HTMLHelper.HTMLEncodeLineBreaks(body));
    }
Esempio n. 3
0
    /// <summary>
    /// Prepare the plain text body of the e-mail message for display.
    /// </summary>
    /// <param name="ei">The e-mail message object</param>
    private void LoadPlainTextBody(EmailInfo ei)
    {
        if (string.IsNullOrEmpty(ei.EmailPlainTextBody))
        {
            lblPlainTextValue.Text = GetString("emailqueue.detail.valuenotentered");
            return;
        }

        DiscussionMacroResolver dmh = new DiscussionMacroResolver {
            ResolveToPlainText = true
        };
        string body = dmh.ResolveMacros(ei.EmailPlainTextBody);

        body = HTMLHelper.HTMLEncode(body);

        // Replace line breaks with br tags and modify discussion macros
        lblPlainTextValue.Text = DiscussionMacroResolver.RemoveTags(HTMLHelper.HTMLEncodeLineBreaks(body));
    }
Esempio n. 4
0
    /// <summary>
    /// Reload data.
    /// </summary>
    public override void ReloadData()
    {
        ForumPostInfo fpi = null;
        ForumInfo     fi;


        #region "Load data"

        if (PostData != null)
        {
            fpi = new ForumPostInfo(PostData);
        }

        if (fpi == null)
        {
            fpi = PostInfo;
        }

        if (fpi != null)
        {
            PostData = fpi.Generalized.DataClass;
            fi       = ForumInfoProvider.GetForumInfo(fpi.PostForumID);
        }
        else
        {
            return;
        }

        #endregion


        if (fi.ForumEnableAdvancedImage)
        {
            ltlText.AllowedControls = ControlsHelper.ALLOWED_FORUM_CONTROLS;
        }
        else
        {
            ltlText.AllowedControls = "none";
        }

        lnkUserName.Text = HTMLHelper.HTMLEncode(fpi.PostUserName);

        // Display converted datetime for live site
        lblDate.Text = " (" + TimeZoneMethods.ConvertDateTime(ValidationHelper.GetDateTime(fpi.PostTime, DateTimeHelper.ZERO_TIME), this).ToString() + ")";

        lblSubject.Text = HTMLHelper.HTMLEncode(fpi.PostSubject);
        DiscussionMacroResolver dmh = new DiscussionMacroResolver();
        dmh.EnableBold          = fi.ForumEnableFontBold;
        dmh.EnableItalics       = fi.ForumEnableFontItalics;
        dmh.EnableStrikeThrough = fi.ForumEnableFontStrike;
        dmh.EnableUnderline     = fi.ForumEnableFontUnderline;
        dmh.EnableCode          = fi.ForumEnableCodeSnippet;
        dmh.EnableColor         = fi.ForumEnableFontColor;
        dmh.EnableImage         = fi.ForumEnableImage || fi.ForumEnableAdvancedImage;
        dmh.EnableQuote         = fi.ForumEnableQuote;
        dmh.EnableURL           = fi.ForumEnableURL || fi.ForumEnableAdvancedURL;
        dmh.MaxImageSideSize    = fi.ForumImageMaxSideSize;
        dmh.QuotePostText       = GetString("DiscussionMacroResolver.QuotePostText");

        if (fi.ForumHTMLEditor)
        {
            dmh.EncodeText = false;
            dmh.ConvertLineBreaksToHTML = false;
        }
        else
        {
            dmh.EncodeText = true;
            dmh.ConvertLineBreaksToHTML = true;
        }

        ltlText.Text = "<div class=\"PostText\">" + dmh.ResolveMacros(fpi.PostText) + "</div>";

        userAvatar.Text = AvatarImage(fpi);

        if (DisplayBadgeInfo)
        {
            if (fpi.PostUserID > 0)
            {
                UserInfo ui = UserInfoProvider.GetUserInfo(fpi.PostUserID);
                if ((ui != null) && !ui.IsPublic())
                {
                    BadgeInfo bi = BadgeInfoProvider.GetBadgeInfo(ui.UserSettings.UserBadgeID);
                    if (bi != null)
                    {
                        ltlBadge.Text = "<div class=\"Badge\">" + HTMLHelper.HTMLEncode(bi.BadgeDisplayName) + "</div>";
                    }
                }
            }

            // Set public badge if no badge is set
            if (String.IsNullOrEmpty(ltlBadge.Text))
            {
                ltlBadge.Text = "<div class=\"Badge\">" + GetString("Forums.PublicBadge") + "</div>";
            }
        }

        if (EnableSignature)
        {
            if (fpi.PostUserSignature.Trim() != "")
            {
                plcSignature.Visible = true;
                ltrSignature.Text    = HTMLHelper.HTMLEncode(fpi.PostUserSignature);
            }
        }

        if (!DisplayOnly)
        {
            string threadId = ForumPostInfoProvider.GetPostRootFromIDPath(ValidationHelper.GetString(GetData(PostData, "PostIdPath"), "")).ToString();

            // Reply
            if (IsAvailable(PostData, ForumActionType.Reply))
            {
                lnkReply.Visible     = true;
                lnkReply.Text        = GetString("Forums_WebInterface_ForumPost.replyLinkText");
                lnkReply.NavigateUrl = URLHelper.UpdateParameterInUrl(GetURL(PostData, ForumActionType.Reply), "threadid", threadId);
            }
            else
            {
                lnkReply.Visible = false;
            }

            // Quote
            if (IsAvailable(PostData, ForumActionType.Quote))
            {
                lnkQuote.Visible     = true;
                lnkQuote.Text        = GetString("Forums_WebInterface_ForumPost.quoteLinkText");
                lnkQuote.NavigateUrl = URLHelper.UpdateParameterInUrl(GetURL(PostData, ForumActionType.Quote), "threadid", threadId);
            }
            else
            {
                lnkQuote.Visible = false;
            }

            // Display subscribe link
            if (IsAvailable(PostData, ForumActionType.SubscribeToPost))
            {
                lnkSubscribe.Visible     = true;
                lnkSubscribe.Text        = GetString("Forums_WebInterface_ForumPost.Subscribe");
                lnkSubscribe.NavigateUrl = URLHelper.UpdateParameterInUrl(GetURL(PostData, ForumActionType.SubscribeToPost), "threadid", threadId);
            }
            else
            {
                lnkSubscribe.Visible = false;
            }

            lnkUserName.CssClass = "PostUserLink";

            if (!String.IsNullOrEmpty(fpi.PostUserMail) && (fi.ForumDisplayEmails))
            {
                lnkUserName.NavigateUrl = "mailto:" + HTMLHelper.HTMLEncode(fpi.PostUserMail) + "?subject=" + HTMLHelper.HTMLEncode(fpi.PostSubject);
                lnkUserName.CssClass    = "PostUser";
            }
        }

        // Display action panel only if reply to link or subscription link are visible
        plcActions.Visible = ((lnkReply.Visible || lnkSubscribe.Visible || lnkQuote.Visible) & !DisplayOnly);

        if ((lnkReply.Visible) && (lnkQuote.Visible || lnkSubscribe.Visible))
        {
            lblActionSeparator.Visible = true;
        }

        if ((lnkQuote.Visible) && (lnkSubscribe.Visible))
        {
            lblActionSeparator2.Visible = true;
        }
    }
    /// <summary>
    /// Reload data.
    /// </summary>
    public override void ReloadData()
    {
        ForumPostInfo fpi = null;
        ForumInfo fi;

        #region "Load data"

        if (PostData != null)
        {
            fpi = new ForumPostInfo(PostData);
        }

        if (fpi == null)
        {
            fpi = PostInfo;
        }

        if (fpi != null)
        {
            PostData = fpi.Generalized.DataClass;
            fi = ForumInfoProvider.GetForumInfo(fpi.PostForumID);
        }
        else
        {
            return;
        }

        #endregion

        if (fi.ForumEnableAdvancedImage)
        {
            ltlText.AllowedControls = ControlsHelper.ALLOWED_FORUM_CONTROLS;
        }
        else
        {
            ltlText.AllowedControls = "none";
        }

        lnkUserName.Text = HTMLHelper.HTMLEncode(fpi.PostUserName);

        // Display converted datetime for live site
        lblDate.Text = " (" + TimeZoneMethods.ConvertDateTime(ValidationHelper.GetDateTime(fpi.PostTime, DateTimeHelper.ZERO_TIME), this).ToString() + ")";

        lblSubject.Text = HTMLHelper.HTMLEncode(fpi.PostSubject);
        DiscussionMacroResolver dmh = new DiscussionMacroResolver();
        dmh.EnableBold = fi.ForumEnableFontBold;
        dmh.EnableItalics = fi.ForumEnableFontItalics;
        dmh.EnableStrikeThrough = fi.ForumEnableFontStrike;
        dmh.EnableUnderline = fi.ForumEnableFontUnderline;
        dmh.EnableCode = fi.ForumEnableCodeSnippet;
        dmh.EnableColor = fi.ForumEnableFontColor;
        dmh.EnableImage = fi.ForumEnableImage || fi.ForumEnableAdvancedImage;
        dmh.EnableQuote = fi.ForumEnableQuote;
        dmh.EnableURL = fi.ForumEnableURL || fi.ForumEnableAdvancedURL;
        dmh.MaxImageSideSize = fi.ForumImageMaxSideSize;
        dmh.QuotePostText = GetString("DiscussionMacroResolver.QuotePostText");

        if (fi.ForumHTMLEditor)
        {
            dmh.EncodeText = false;
            dmh.ConvertLineBreaksToHTML = false;
        }
        else
        {
            dmh.EncodeText = true;
            dmh.ConvertLineBreaksToHTML = true;
        }

        ltlText.Text = "<div class=\"PostText\">" + dmh.ResolveMacros(fpi.PostText) + "</div>";

        userAvatar.Text = AvatarImage(fpi);

        if (DisplayBadgeInfo)
        {
            if (fpi.PostUserID > 0)
            {
                UserInfo ui = UserInfoProvider.GetUserInfo(fpi.PostUserID);
                if ((ui != null) && !ui.IsPublic())
                {
                    BadgeInfo bi = BadgeInfoProvider.GetBadgeInfo(ui.UserSettings.UserBadgeID);
                    if (bi != null)
                    {
                        ltlBadge.Text = "<div class=\"Badge\">" + HTMLHelper.HTMLEncode(bi.BadgeDisplayName) + "</div>";
                    }
                }
            }

            // Set public badge if no badge is set
            if (String.IsNullOrEmpty(ltlBadge.Text))
            {
                ltlBadge.Text = "<div class=\"Badge\">" + GetString("Forums.PublicBadge") + "</div>";
            }
        }

        if (EnableSignature)
        {
            if (fpi.PostUserSignature.Trim() != "")
            {
                plcSignature.Visible = true;
                ltrSignature.Text = HTMLHelper.HTMLEncode(fpi.PostUserSignature);
            }
        }

        if (!DisplayOnly)
        {
            string threadId = ForumPostInfoProvider.GetPostRootFromIDPath(ValidationHelper.GetString(GetData(PostData, "PostIdPath"), "")).ToString();

            // Reply
            if (IsAvailable(PostData, ForumActionType.Reply))
            {
                lnkReply.Visible = true;
                lnkReply.Text = GetString("Forums_WebInterface_ForumPost.replyLinkText");
                lnkReply.NavigateUrl = URLHelper.UpdateParameterInUrl(GetURL(PostData, ForumActionType.Reply), "threadid", threadId);
            }
            else
            {
                lnkReply.Visible = false;
            }

            // Quote
            if (IsAvailable(PostData, ForumActionType.Quote))
            {
                lnkQuote.Visible = true;
                lnkQuote.Text = GetString("Forums_WebInterface_ForumPost.quoteLinkText");
                lnkQuote.NavigateUrl = URLHelper.UpdateParameterInUrl(GetURL(PostData, ForumActionType.Quote), "threadid", threadId);
            }
            else
            {
                lnkQuote.Visible = false;
            }

            // Display subscribe link
            if (IsAvailable(PostData, ForumActionType.SubscribeToPost))
            {
                lnkSubscribe.Visible = true;
                lnkSubscribe.Text = GetString("Forums_WebInterface_ForumPost.Subscribe");
                lnkSubscribe.NavigateUrl = URLHelper.UpdateParameterInUrl(GetURL(PostData, ForumActionType.SubscribeToPost), "threadid", threadId);
            }
            else
            {
                lnkSubscribe.Visible = false;
            }

            lnkUserName.CssClass = "PostUserLink";

            if (!String.IsNullOrEmpty(fpi.PostUserMail) && (fi.ForumDisplayEmails))
            {
                lnkUserName.NavigateUrl = "mailto:" + HTMLHelper.HTMLEncode(fpi.PostUserMail) + "?subject=" + HTMLHelper.HTMLEncode(fpi.PostSubject);
                lnkUserName.CssClass = "PostUser";
            }
        }

        // Display action panel only if reply to link or subscription link are visible
        plcActions.Visible = ((lnkReply.Visible || lnkSubscribe.Visible || lnkQuote.Visible) & !DisplayOnly);

        if ((lnkReply.Visible) && (lnkQuote.Visible || lnkSubscribe.Visible))
        {
            lblActionSeparator.Visible = true;
        }

        if ((lnkQuote.Visible) && (lnkSubscribe.Visible))
        {
            lblActionSeparator2.Visible = true;
        }
    }
    /// <summary>
    /// Loads the data.
    /// </summary>
    private void LoadData()
    {
        // Get the forum post
        ForumPostInfo fpi = ForumPostInfoProvider.GetForumPostInfo(ValidationHelper.GetInteger(PostID, 0));
        ForumInfo fi = null;

        if (fpi != null)
        {
            fi = ForumInfoProvider.GetForumInfo(fpi.PostForumID);
        }
        else
        {
            return;
        }

        if (fi.ForumEnableAdvancedImage)
        {
            ltrText.AllowedControls = ControlsHelper.ALLOWED_FORUM_CONTROLS;
        }
        else
        {
            ltrText.AllowedControls = "none";
        }

        // Display converted datetime for live site
        lblDate.Text = TimeZoneMethods.ConvertDateTime(ValidationHelper.GetDateTime(fpi.PostTime, DateTimeHelper.ZERO_TIME), this).ToString();

        lblUser.Text = HTMLHelper.HTMLEncode(fpi.PostUserName);
        lblSubject.Text = HTMLHelper.HTMLEncode(fpi.PostSubject);

        DiscussionMacroResolver dmh = new DiscussionMacroResolver();
        dmh.EnableBold = fi.ForumEnableFontBold;
        dmh.EnableItalics = fi.ForumEnableFontItalics;
        dmh.EnableStrikeThrough = fi.ForumEnableFontStrike;
        dmh.EnableUnderline = fi.ForumEnableFontUnderline;
        dmh.EnableCode = fi.ForumEnableCodeSnippet;
        dmh.EnableColor = fi.ForumEnableFontColor;
        dmh.EnableImage = fi.ForumEnableImage || fi.ForumEnableAdvancedImage;
        dmh.EnableQuote = fi.ForumEnableQuote;
        dmh.EnableURL = fi.ForumEnableURL || fi.ForumEnableAdvancedURL;
        dmh.MaxImageSideSize = fi.ForumImageMaxSideSize;
        dmh.QuotePostText = GetString("DiscussionMacroResolver.QuotePostText");

        if (fi.ForumHTMLEditor)
        {
            dmh.EncodeText = false;
            dmh.ConvertLineBreaksToHTML = false;
        }
        else
        {
            dmh.EncodeText = true;
            dmh.ConvertLineBreaksToHTML = true;
        }

        // Resolve the macros and display the post text
        ltrText.Text = dmh.ResolveMacros(fpi.PostText);
    }
    /// <summary>
    /// Gets the plain text body of the e-mail message.
    /// </summary>
    /// <param name="ei">The e-mail message object</param>
    /// <returns>Plain-text body</returns>
    private string GetPlainTextBody(EmailInfo ei)
    {
        DiscussionMacroResolver dmh = new DiscussionMacroResolver { ResolveToPlainText = true };
        string body = dmh.ResolveMacros(ei.EmailPlainTextBody);

        body = HTMLHelper.HTMLEncode(body);

        lblBodyValue.Visible = true;

        // Replace line breaks with br tags and modify discussion macros
        lblBodyValue.Text = DiscussionMacroResolver.RemoveTags(HTMLHelper.HTMLEncodeLineBreaks(body));

        return body;
    }
Esempio n. 8
0
    public void ReloadData()
    {
        if (StopProcessing)
        {
            // Do nothing
            MessageUserButtonsControl.StopProcessing = true;
            UserPictureControl.StopProcessing        = true;
        }
        else
        {
            MessageUserButtonsControl.StopProcessing = false;
            UserPictureControl.StopProcessing        = false;

            if (Message != null)
            {
                // Get current user info
                currentUserInfo = MembershipContext.AuthenticatedUser;
                // Get message user info
                if (MessageMode == MessageModeEnum.Inbox)
                {
                    messageUserInfo = UserInfoProvider.GetUserInfo(Message.MessageSenderUserID);
                }
                else
                {
                    messageUserInfo = UserInfoProvider.GetUserInfo(Message.MessageRecipientUserID);
                }

                // Display only to authorized user
                if ((currentUserInfo.UserID == Message.MessageRecipientUserID) ||
                    (currentUserInfo.UserID == Message.MessageSenderUserID) ||
                    currentUserInfo.CheckPrivilegeLevel(UserPrivilegeLevelEnum.Admin))
                {
                    pnlViewMessage.Visible = true;
                    lblDateCaption.Text    = GetString("Messaging.Date");
                    lblSubjectCaption.Text = GetString("general.subject");
                    lblFromCaption.Text    = (MessageMode == MessageModeEnum.Inbox) ? GetString("Messaging.From") : GetString("Messaging.To");

                    // Sender exists
                    if (messageUserInfo != null)
                    {
                        UserPictureControl.Visible = true;
                        UserPictureControl.UserID  = messageUserInfo.UserID;

                        // Gravatar support
                        string avType = SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".CMSAvatarType");
                        if (avType == AvatarInfoProvider.USERCHOICE)
                        {
                            avType = messageUserInfo.UserSettings.UserAvatarType;
                        }

                        UserPictureControl.UserAvatarType = avType;

                        // Disable message user buttons on live site for hidden or disabled users
                        if (IsLiveSite && !currentUserInfo.CheckPrivilegeLevel(UserPrivilegeLevelEnum.Admin) && (messageUserInfo.UserIsDisabledManually || messageUserInfo.UserIsHidden))
                        {
                            MessageUserButtonsControl.RelatedUserId = 0;
                        }
                        else
                        {
                            MessageUserButtonsControl.RelatedUserId = messageUserInfo.UserID;
                        }
                        lblFrom.Text = HTMLHelper.HTMLEncode(Functions.GetFormattedUserName(messageUserInfo.UserName, messageUserInfo.FullName, messageUserInfo.UserNickName, IsLiveSite));
                    }
                    else
                    {
                        MessageUserButtonsControl.RelatedUserId = 0;
                        lblFrom.Text = HTMLHelper.HTMLEncode(Message.MessageSenderNickName);
                    }
                    string body = Message.MessageBody;
                    // Resolve macros
                    DiscussionMacroResolver dmh = new DiscussionMacroResolver();
                    body = dmh.ResolveMacros(body);

                    lblSubject.Text = HTMLHelper.HTMLEncodeLineBreaks(Message.MessageSubject);
                    if (IsLiveSite)
                    {
                        lblDate.Text = TimeZoneUIMethods.ConvertDateTime(Message.MessageSent, this).ToString();
                    }
                    else
                    {
                        lblDate.Text = TimeZoneHelper.ConvertToUserTimeZone(Message.MessageSent, true, currentUserInfo, SiteContext.CurrentSite);
                    }
                    lblBody.Text = body;
                }
            }
            else
            {
                ShowError(GetString("Messaging.MessageDoesntExist"));
            }
        }
    }
    public void ReloadData()
    {
        if (StopProcessing)
        {
            // Do nothing
            MessageUserButtonsControl.StopProcessing = true;
            UserPictureControl.StopProcessing = true;
        }
        else
        {
            MessageUserButtonsControl.StopProcessing = false;
            UserPictureControl.StopProcessing = false;

            if (Message != null)
            {
                // Get current user info
                currentUserInfo = MembershipContext.AuthenticatedUser;
                // Get message user info
                if (MessageMode == MessageModeEnum.Inbox)
                {
                    messageUserInfo = UserInfoProvider.GetUserInfo(Message.MessageSenderUserID);
                }
                else
                {
                    messageUserInfo = UserInfoProvider.GetUserInfo(Message.MessageRecipientUserID);
                }

                // Display only to authorized user
                if ((currentUserInfo.UserID == Message.MessageRecipientUserID) || (currentUserInfo.UserID == Message.MessageSenderUserID) || currentUserInfo.IsGlobalAdministrator)
                {
                    pnlViewMessage.Visible = true;
                    lblDateCaption.Text = GetString("Messaging.Date");
                    lblSubjectCaption.Text = GetString("general.subject");
                    lblFromCaption.Text = (MessageMode == MessageModeEnum.Inbox) ? GetString("Messaging.From") : GetString("Messaging.To");

                    // Sender exists
                    if (messageUserInfo != null)
                    {
                        UserPictureControl.Visible = true;
                        UserPictureControl.UserID = messageUserInfo.UserID;

                        // Gravatar support
                        string avType = SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".CMSAvatarType");
                        if (avType == AvatarInfoProvider.USERCHOICE)
                        {
                           avType = messageUserInfo.UserSettings.UserAvatarType;
                        }

                        UserPictureControl.UserAvatarType = avType;

                        // Disable message user buttons on live site for hidden or disabled users
                        if (IsLiveSite && !currentUserInfo.IsGlobalAdministrator && (messageUserInfo.UserIsDisabledManually || messageUserInfo.UserIsHidden))
                        {
                            MessageUserButtonsControl.RelatedUserId = 0;
                        }
                        else
                        {
                            MessageUserButtonsControl.RelatedUserId = messageUserInfo.UserID;
                        }
                        lblFrom.Text = HTMLHelper.HTMLEncode(Functions.GetFormattedUserName(messageUserInfo.UserName, messageUserInfo.FullName, messageUserInfo.UserNickName, IsLiveSite));
                    }
                    else
                    {
                        MessageUserButtonsControl.RelatedUserId = 0;
                        lblFrom.Text = HTMLHelper.HTMLEncode(Message.MessageSenderNickName);
                    }
                    string body = Message.MessageBody;
                    // Resolve macros
                    DiscussionMacroResolver dmh = new DiscussionMacroResolver();
                    body = dmh.ResolveMacros(body);

                    lblSubject.Text = HTMLHelper.HTMLEncodeLineBreaks(Message.MessageSubject);
                    if (IsLiveSite)
                    {
                        lblDate.Text = TimeZoneMethods.ConvertDateTime(Message.MessageSent, this).ToString();
                    }
                    else
                    {
                        lblDate.Text = TimeZoneHelper.ConvertToUserTimeZone(Message.MessageSent, true, currentUserInfo, SiteContext.CurrentSite);
                    }
                    lblBody.Text = body;
                }
            }
            else
            {
                ShowError(GetString("Messaging.MessageDoesntExist"));
            }
        }
    }