コード例 #1
0
        private void InitEditedPost(DataRow currentRow, string message, MessageFlags messageFlags)
        {
            // If the message is in BBCode but the editor uses HTML, convert the message text to HTML
            if (messageFlags.IsBBCode && _forumEditor.UsesHTML)
            {
                message = BBCode.ConvertBBCodeToHtmlForEdit(message);
            }

            _forumEditor.Text = message;

            Title.Text = GetText("EDIT");

            // add topic link...
            PageLinks.AddLink(Server.HtmlDecode(currentRow["Topic"].ToString()),
                              YAF.Classes.Utils.YafBuildLink.GetLink(YAF.Classes.Utils.ForumPages.posts, "m={0}", EditTopicID));
            // editing..
            PageLinks.AddLink(GetText("EDIT"));

            string blogPostID = currentRow["BlogPostID"].ToString();

            if (blogPostID != string.Empty)             // The user used this post to blog
            {
                BlogPostID.Value   = blogPostID;
                PostToBlog.Checked = true;
                BlogRow.Visible    = true;
            }

            Subject.Text = Server.HtmlDecode(Convert.ToString(currentRow["Topic"]));

            if ((Convert.ToInt32(currentRow["TopicOwnerID"]) == Convert.ToInt32(currentRow["UserID"])) ||
                PageContext.ForumModeratorAccess)
            {
                // allow editing of the topic subject
                Subject.Enabled = true;
            }
            else
            {
                // disable the subject
                Subject.Enabled = false;
            }

            Priority.SelectedItem.Selected = false;
            Priority.Items.FindByValue(currentRow["Priority"].ToString()).Selected = true;
            EditReasonRow.Visible = true;
            ReasonEditor.Text     = Server.HtmlDecode(Convert.ToString(currentRow["EditReason"]));
            Persistency.Checked   = messageFlags.IsPersistent;
        }
コード例 #2
0
        private void InitQuotedReply(DataRow currentRow, string message, MessageFlags messageFlags)
        {
            if (PageContext.BoardSettings.RemoveNestedQuotes)
            {
                message = FormatMsg.RemoveNestedQuotes(message);
            }

            // If the message being quoted in BBCode but the editor uses HTML, convert the message text to HTML
            if (messageFlags.IsBBCode && _forumEditor.UsesHTML)
            {
                message = BBCode.ConvertBBCodeToHtmlForEdit(message);
            }

            // Ensure quoted replies have bad words removed from them
            message = General.BadWordReplace(message);

            // Quote the original message
            _forumEditor.Text = String.Format("[quote={0}]{1}[/quote]\n", currentRow["username"], message).TrimStart();
        }