Example #1
0
        protected override void ShowPage()
        {
            if (usergroupinfo.Radminid == 0)
            {
                AddErrLine("您没有推荐主题的权限!");
                return;
            }
            if (tid == -1)
            {
                return;
            }
            DataTable postInfo = BlockEntries.GetPostInfoByTid(tid);

            title        = postInfo.Rows[0]["title"].ToString();
            summary      = Utils.RemoveHtml(Utils.ClearUBB(postInfo.Rows[0]["message"].ToString().Trim()));
            poster       = postInfo.Rows[0]["poster"].ToString();
            postdatetime = postInfo.Rows[0]["postdatetime"].ToString().Trim();
            //如果是提交...
            if (ispost)
            {
                blockid   = DNTRequest.GetFormInt("blockid", -1);
                blockName = DNTRequest.GetFormString("blockname");
                title     = DNTRequest.GetFormString("topicTitle");
                summary   = DNTRequest.GetFormString("summary");
                NormalValidate(blockName, blockid, title, summary);

                BlockEntryInfo blockEntries = new BlockEntryInfo();
                blockEntries.title             = title;
                blockEntries.blockid           = blockid;
                blockEntries.image             = DNTRequest.GetFormString("selectImage");
                blockEntries.summary           = summary;
                blockEntries.author            = DNTRequest.GetFormString("poster");
                blockEntries.postdatetime      = TypeConverter.StrToDateTime(DNTRequest.GetFormString("postdatetime"));
                blockEntries.link              = "showtopic.aspx?tid=" + tid;
                blockEntries.foretag           = "";
                blockEntries.reartag           = "";
                blockEntries.color             = "";
                blockEntries.html              = "";
                blockEntries.pushedbyuid       = userid;
                blockEntries.pubshedbyusername = username;
                blockEntries.pusheddatetime    = DateTime.Now;
                blockEntries.displayorder      = 1;
                BlockEntries.AddBlockEntry(blockEntries);
                AddMsgLine("推荐成功");
                SetUrl(Urls.ShowDebateAspxRewrite(topicid));
                #region 验证提交信息
                if (IsErr())
                {
                    return;
                }

                //// 如果用户上传了附件,则检测用户是否有上传附件的权限
                //if (ForumUtils.IsPostFile())
                //{
                //    if (Utils.StrIsNullOrEmpty(Attachments.GetAttachmentTypeArray(attachmentTypeSelect)))
                //        AddErrLine("系统不允许上传附件");

                //    if (!UserAuthority.PostAttachAuthority(forum, usergroupinfo, userid, ref msg))
                //        AddErrLine(msg);
                //}

                ////发悬赏校验
                //int topicprice = 0;
                //bool isbonus = type == "bonus";
                //ValidateBonus(ref topicprice, ref isbonus);

                ////发特殊主题校验
                //ValidatePollAndDebate();

                //if (IsErr())
                //    return;
                #endregion
                if (IsErr())
                {
                    return;
                }

                if (IsErr())
                {
                    return;
                }

                //如果已登录就不需要再登录
                if (needlogin && userid > 0)
                {
                    needlogin = false;
                }
            }
            else //非提交操作
            {
                AddLinkCss(BaseConfigs.GetForumPath + "templates/" + templatepath + "/editor.css", "css");
            }
        }