Exemplo n.º 1
0
        private void SubmitBatchSet_Click(object sender, EventArgs e)
        {
            #region 写入批量论坛设置信息

            string targetlist = DNTRequest.GetString("Forumtree1");

            if ((targetlist == "") || (targetlist == ",") || (targetlist == "0"))
            {
                base.RegisterStartupScript("", "<script>alert('您未选中任何版块, 系统无法提交! ');</script>");
                return;
            }

            __foruminfo = AdminForums.GetForumInfomation(DNTRequest.GetInt("fid", -1));
            __foruminfo.Allowsmilies     = BoolToInt(setting.Items[0].Selected);
            __foruminfo.Allowrss         = BoolToInt(setting.Items[1].Selected);
            __foruminfo.Allowhtml        = 0;
            __foruminfo.Allowbbcode      = BoolToInt(setting.Items[2].Selected);
            __foruminfo.Allowimgcode     = BoolToInt(setting.Items[3].Selected);
            __foruminfo.Allowblog        = 0;
            __foruminfo.Istrade          = 0;
            __foruminfo.Alloweditrules   = 0;
            __foruminfo.Recyclebin       = BoolToInt(setting.Items[4].Selected);
            __foruminfo.Modnewposts      = BoolToInt(setting.Items[5].Selected);
            __foruminfo.Jammer           = BoolToInt(setting.Items[6].Selected);
            __foruminfo.Disablewatermark = BoolToInt(setting.Items[7].Selected);
            __foruminfo.Inheritedmod     = BoolToInt(setting.Items[8].Selected);
            __foruminfo.Allowthumbnail   = BoolToInt(setting.Items[9].Selected);
            __foruminfo.Password         = password.Text;
            __foruminfo.Attachextensions = attachextensions.GetSelectString(",");
            __foruminfo.Viewperm         = viewperm.GetSelectString(",");
            __foruminfo.Postperm         = postperm.GetSelectString(",");
            __foruminfo.Replyperm        = replyperm.GetSelectString(",");
            __foruminfo.Getattachperm    = getattachperm.GetSelectString(",");
            __foruminfo.Postattachperm   = postattachperm.GetSelectString(",");

            BatchSetParams bsp = new BatchSetParams();
            bsp.SetPassWord         = setpassword.Checked;
            bsp.SetAttachExtensions = setattachextensions.Checked;
            bsp.SetPostCredits      = setpostcredits.Checked;
            bsp.SetReplyCredits     = setreplycredits.Checked;
            bsp.SetSetting          = setsetting.Checked;
            bsp.SetViewperm         = setviewperm.Checked;
            bsp.SetPostperm         = setpostperm.Checked;
            bsp.SetReplyperm        = setreplyperm.Checked;
            bsp.SetGetattachperm    = setgetattachperm.Checked;
            bsp.SetPostattachperm   = setpostattachperm.Checked;

            if (AdminForums.BatchSetForumInf(__foruminfo, bsp, targetlist))
            {
                base.RegisterStartupScript("PAGE", "window.location.href='forum_ForumsTree.aspx';");
            }
            else
            {
                base.RegisterStartupScript("", "<script>alert('提交不成功!');window.location.href='forum_ForumsTree.aspx';</script>");
            }

            #endregion
        }
Exemplo n.º 2
0
        private void SubmitBatchSet_Click(object sender, EventArgs e)
        {
            #region 写入批量论坛设置信息

            string targetlist = DNTRequest.GetString("Forumtree1");

            if ((targetlist == "") || (targetlist == ",") || (targetlist == "0"))
            {
                base.RegisterStartupScript("", "<script>alert('您未选中任何版块, 系统无法提交! ');</script>");
                return;
            }

            forumInfo                  = Forums.GetForumInfo(DNTRequest.GetInt("fid", -1));
            forumInfo.Allowhtml        = 0;
            forumInfo.Allowblog        = 0;
            forumInfo.Istrade          = 0;
            forumInfo.Alloweditrules   = 0;
            forumInfo.Allowsmilies     = BoolToInt(setting.Items[0].Selected);
            forumInfo.Allowrss         = BoolToInt(setting.Items[1].Selected);
            forumInfo.Allowbbcode      = BoolToInt(setting.Items[2].Selected);
            forumInfo.Allowimgcode     = BoolToInt(setting.Items[3].Selected);
            forumInfo.Recyclebin       = BoolToInt(setting.Items[4].Selected);
            forumInfo.Modnewposts      = BoolToInt(setting.Items[5].Selected);
            forumInfo.Jammer           = BoolToInt(setting.Items[6].Selected);
            forumInfo.Disablewatermark = BoolToInt(setting.Items[7].Selected);
            forumInfo.Inheritedmod     = BoolToInt(setting.Items[8].Selected);
            forumInfo.Allowthumbnail   = BoolToInt(setting.Items[9].Selected);
            forumInfo.Allowtag         = BoolToInt(setting.Items[10].Selected);
            int temppostspecial = 0;
            temppostspecial            = setting.Items[11].Selected ? temppostspecial | 1 : temppostspecial & ~1;
            temppostspecial            = setting.Items[12].Selected ? temppostspecial | 16 : temppostspecial & ~16;
            temppostspecial            = setting.Items[13].Selected ? temppostspecial | 4 : temppostspecial & ~4;
            forumInfo.Allowpostspecial = temppostspecial;
            forumInfo.Alloweditrules   = BoolToInt(setting.Items[14].Selected);
            forumInfo.Password         = password.Text;
            forumInfo.Attachextensions = attachextensions.GetSelectString(",");
            forumInfo.Viewperm         = viewperm.GetSelectString(",");
            forumInfo.Postperm         = postperm.GetSelectString(",");
            forumInfo.Replyperm        = replyperm.GetSelectString(",");
            forumInfo.Getattachperm    = getattachperm.GetSelectString(",");
            forumInfo.Postattachperm   = postattachperm.GetSelectString(",");

            BatchSetParams bsp = new BatchSetParams();
            bsp.SetPassWord         = setpassword.Checked;
            bsp.SetAttachExtensions = setattachextensions.Checked;
            bsp.SetPostCredits      = setpostcredits.Checked;
            bsp.SetReplyCredits     = setreplycredits.Checked;
            bsp.SetSetting          = setsetting.Checked;
            bsp.SetViewperm         = setviewperm.Checked;
            bsp.SetPostperm         = setpostperm.Checked;
            bsp.SetReplyperm        = setreplyperm.Checked;
            bsp.SetGetattachperm    = setgetattachperm.Checked;
            bsp.SetPostattachperm   = setpostattachperm.Checked;

            if (AdminForums.BatchSetForumInf(forumInfo, bsp, targetlist))
            {
                ForumOperator.RefreshForumCache();
                AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "复制版块设置", "编辑论坛版块列表为:" + targetlist.Trim());
                base.RegisterStartupScript("PAGE", "window.location.href='forum_ForumsTree.aspx';");
            }
            else
            {
                base.RegisterStartupScript("", "<script>alert('提交不成功!');window.location.href='forum_ForumsTree.aspx';</script>");
            }

            #endregion
        }