コード例 #1
0
        protected void BtnQuote_OnClick(object sender, EventArgs e)
        {
            int forumPostId = 0;

            int.TryParse(lblForumPostId.Text, out forumPostId);
            var forumPost = ForumManager.GetPostById(forumPostId);

            if (forumPost != null)
            {
                Response.Redirect(SEOHelper.GetNewForumPostUrl(forumPost.TopicId, forumPost.ForumPostId));
            }
        }
コード例 #2
0
        protected void btnReply_Click(object sender, EventArgs e)
        {
            var forumTopic = this.ForumService.GetTopicById(this.TopicId);

            if (forumTopic != null)
            {
                if (NopContext.Current.User == null && this.ForumService.AllowGuestsToCreatePosts)
                {
                    this.CustomerService.CreateAnonymousUser();
                }

                if (!this.ForumService.IsUserAllowedToCreatePost(NopContext.Current.User, forumTopic))
                {
                    string loginURL = SEOHelper.GetLoginPageUrl(true);
                    Response.Redirect(loginURL);
                }

                string newForumPostURL = SEOHelper.GetNewForumPostUrl(forumTopic.ForumTopicId);
                Response.Redirect(newForumPostURL);
            }
        }