private void SubmitBatchSet_Click(object sender, EventArgs e) { string fidlist = Request["Forumtree1"]; if (String.IsNullOrEmpty(fidlist) || fidlist == "," || fidlist == "0") { base.RegisterStartupScript("", "<script>alert('您未选中任何版块, 系统无法提交! ');</script>"); return; } this.forumInfo = Forums.GetForumInfo(DNTRequest.GetInt("fid", -1)); //this.forumInfo.AllowHtml = 0; //this.forumInfo.AllowBlog = 0; //this.forumInfo.IsTrade = 0; //this.forumInfo.AllowEditRules = 0; this.forumInfo.AllowSmilies = this.setting.Items[0].Selected; this.forumInfo.AllowRss = this.setting.Items[1].Selected; this.forumInfo.AllowBbCode = this.setting.Items[2].Selected; this.forumInfo.AllowImgCode = this.setting.Items[3].Selected; this.forumInfo.Recyclebin = this.BoolToInt(this.setting.Items[4].Selected); this.forumInfo.Modnewposts = this.BoolToInt(this.setting.Items[5].Selected); this.forumInfo.Jammer = this.BoolToInt(this.setting.Items[6].Selected); this.forumInfo.DisableWatermark = this.setting.Items[7].Selected; this.forumInfo.Inheritedmod = this.BoolToInt(this.setting.Items[8].Selected); this.forumInfo.AllowThumbnail = this.setting.Items[9].Selected; this.forumInfo.AllowTag = this.setting.Items[10].Selected; int num = 0; num = (this.setting.Items[11].Selected ? (num | 1) : (num & -2)); num = (this.setting.Items[12].Selected ? (num | 16) : (num & -17)); num = (this.setting.Items[13].Selected ? (num | 4) : (num & -5)); this.forumInfo.AllowPostSpecial = num; this.forumInfo.AllowEditRules = this.setting.Items[14].Selected; this.forumInfo.Password = this.password.Text; this.forumInfo.Attachextensions = this.attachextensions.GetSelectString(","); this.forumInfo.ViewPerm = this.viewperm.GetSelectString(","); this.forumInfo.PostPerm = this.postperm.GetSelectString(","); this.forumInfo.ReplyPerm = this.replyperm.GetSelectString(","); this.forumInfo.GetattachPerm = this.getattachperm.GetSelectString(","); this.forumInfo.PostattachPerm = this.postattachperm.GetSelectString(","); BatchSetParams bsp = default(BatchSetParams); bsp.SetPassWord = this.setpassword.Checked; bsp.SetAttachExtensions = this.setattachextensions.Checked; bsp.SetPostCredits = this.setpostcredits.Checked; bsp.SetReplyCredits = this.setreplycredits.Checked; bsp.SetSetting = this.setsetting.Checked; bsp.SetViewperm = this.setviewperm.Checked; bsp.SetPostperm = this.setpostperm.Checked; bsp.SetReplyperm = this.setreplyperm.Checked; bsp.SetGetattachperm = this.setgetattachperm.Checked; bsp.SetPostattachperm = this.setpostattachperm.Checked; if (XForum.BatchSet(this.forumInfo, bsp, fidlist)) { ForumOperator.RefreshForumCache(); AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "复制版块设置", "编辑论坛版块列表为:" + fidlist.Trim()); base.RegisterStartupScript("PAGE", "window.location.href='forum_ForumsTree.aspx';"); return; } base.RegisterStartupScript("", "<script>alert('提交不成功!');window.location.href='forum_ForumsTree.aspx';</script>"); }
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 }
/// <summary> /// 批理设置论坛信息 /// </summary> /// <param name="__foruminfo">复制的论坛信息</param> /// <param name="bsp">是否要批量设置的信息字段</param> /// <param name="fidlist">目标论坛(fid)串</param> /// <returns></returns> public static bool BatchSetForumInf(ForumInfo __foruminfo, BatchSetParams bsp, string fidlist) { return(DatabaseProvider.GetInstance().BatchSetForumInf(__foruminfo, bsp, fidlist)); }
/// <summary> /// 批理设置论坛信息 /// </summary> /// <param name="__foruminfo">复制的论坛信息</param> /// <param name="bsp">是否要批量设置的信息字段</param> /// <param name="fidlist">目标论坛(fid)串</param> /// <returns></returns> public static bool BatchSetForumInf(ForumInfo forumInfo, BatchSetParams bsp, string fidlist) { return(Discuz.Data.Forums.BatchSetForumInf(forumInfo, bsp, fidlist)); }
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 }