private void EditSmile_Click(object sender, EventArgs e) { #region 编辑表情修改 int row = 0; bool isError = false; foreach (object o in smilesgrid.GetKeyIDArray()) { if (!Utils.IsNumeric(smilesgrid.GetControlValue(row, "displayorder"))) { isError = true; continue; } else { AdminForums.UpdateSmilies(int.Parse(o.ToString()), int.Parse(smilesgrid.GetControlValue(row, "displayorder")), DNTRequest.GetInt("typeid", 0), smilesgrid.GetControlValue(row, "code"), smilesgrid.GetControlValue(row, "url"), userid, username, usergroupid, grouptitle, ip); } row++; } if (isError) { base.RegisterStartupScript("", "<script>alert('批量更新出现输入错误,某些记录未能更新');window.location.href='forum_smilegrid.aspx?typeid=" + DNTRequest.GetInt("typeid", 0) + "';</script>"); } else { base.RegisterStartupScript("", "<script>window.location.href='forum_smilegrid.aspx?typeid=" + DNTRequest.GetInt("typeid", 0) + "';</script>"); } #endregion }
private void SaveSmiles_Click(object sender, EventArgs e) { #region 保存对表情信息的编辑 if (this.CheckCookie()) { int rowid = -1; bool error = false; foreach (object o in smilesgrid.GetKeyIDArray()) { string id = o.ToString(); string code = smilesgrid.GetControlValue(rowid, "code"); string displayorder = smilesgrid.GetControlValue(rowid, "displayorder"); string type = smilesgrid.GetControlValue(rowid, "type"); string url = smilesgrid.GetControlValue(rowid, "url"); rowid++; if (code == "" || !Utils.IsNumeric(displayorder) || Smilies.IsExistSameSmilieCode(code, int.Parse(id))) { error = true; continue; } AdminForums.UpdateSmilies(int.Parse(id), int.Parse(displayorder), Utils.StrToInt(type, 0), code, url, userid, username, usergroupid, grouptitle, ip); } if (error) { base.RegisterStartupScript("", "<script>alert('某些记录输入不完整或数据库中已存在相同的表情组名称');window.location.href='forum_smiliemanage.aspx';</script>"); } else { base.RegisterStartupScript("", "<script>window.location.href='forum_smiliemanage.aspx';</script>"); } } #endregion }
private void SaveSmiles_Click(object sender, EventArgs e) { if (base.CheckCookie()) { int num = -1; bool flag = false; foreach (object current in this.smilesgrid.GetKeyIDArray()) { string s = current.ToString(); string controlValue = this.smilesgrid.GetControlValue(num, "code"); string controlValue2 = this.smilesgrid.GetControlValue(num, "displayorder"); string controlValue3 = this.smilesgrid.GetControlValue(num, "type"); string controlValue4 = this.smilesgrid.GetControlValue(num, "url"); num++; if (String.IsNullOrEmpty(controlValue) || !Utils.IsNumeric(controlValue2) || Smilies.IsExistSameSmilieCode(controlValue, int.Parse(s))) { flag = true; } else { AdminForums.UpdateSmilies(int.Parse(s), int.Parse(controlValue2), controlValue3.ToInt(0), controlValue, controlValue4, this.userid, this.username, this.usergroupid, this.grouptitle, this.ip); } } if (flag) { base.RegisterStartupScript("", "<script>alert('某些记录输入不完整或数据库中已存在相同的表情组名称');window.location.href='forum_smiliemanage.aspx';</script>"); return; } base.RegisterStartupScript("", "<script>window.location.href='forum_smiliemanage.aspx';</script>"); } }
public void SubmitButton_Click(object sender, EventArgs e) { bool err = false; for (int i = 1; i <= fileList.Count; i++) { if (DNTRequest.GetFormString("id" + i) != "") { try { if (!Utils.IsNumeric(DNTRequest.GetInt("typeid", 0))) { err = true; continue; } AdminForums.CreateSmilies(DNTRequest.GetFormInt("order" + i, 0), DNTRequest.GetInt("typeid", 0), DNTRequest.GetFormString("code" + i), DNTRequest.GetFormString("url" + i), userid, username, usergroupid, grouptitle, ip); } catch { base.RegisterStartupScript("", "<script>alert('出现错误,可能文件超出长度!');window.location.href='forum_smilegrid.aspx?typeid=" + DNTRequest.GetInt("typeid", 0) + "';</script>"); } } } base.RegisterStartupScript("", "<script>" + (err ? "alert('增加的记录中某个显示顺序是非数字,该记录未能增加!');" : "") + "window.location.href='forum_smilegrid.aspx?typeid=" + DNTRequest.GetInt("typeid", 0) + "';</script>"); }
public void SubmitButton_Click(object sender, EventArgs e) { #region 提交所选的表情分类 for (int i = 1; i <= dirList.Count; i++) { if (DNTRequest.GetFormString("id" + i) != null && DNTRequest.GetFormString("id" + i) != "") { AdminForums.CreateSmilies(DNTRequest.GetInt("order" + i, 0), 0, DNTRequest.GetFormString("group" + i), DNTRequest.GetFormString("url" + i), userid, username, usergroupid, grouptitle, ip); //将新增表情分类中的表情入库 int maxSmilieId = Smilies.GetMaxSmiliesId() - 1; int order = 1; string url = DNTRequest.GetFormString("url" + i); ArrayList fileList = GetSmilesFileList(DNTRequest.GetFormString("url" + i)); foreach (string file in fileList) { if (file.ToLower() == "thumbs.db") //过滤掉thumbs.db文件 { continue; } AdminForums.CreateSmilies(order, maxSmilieId, ":" + url + order + ":", url + "/" + file, userid, username, usergroupid, grouptitle, ip); order++; } } } base.RegisterStartupScript("", "<script>window.location.href='forum_smiliemanage.aspx';</script>"); #endregion }
private void SaveForum_Click(object sender, EventArgs e) { #region 保存版块修改信息 int row = -1; bool error = false; foreach (object o in DataGrid1.GetKeyIDArray()) { int fid = int.Parse(o.ToString()); string name = DataGrid1.GetControlValue(row, "name").Trim(); string subforumcount = DataGrid1.GetControlValue(row, "subforumcount").Trim(); string displayorder = DataGrid1.GetControlValue(row, "displayorder").Trim(); if (name == "" || !Utils.IsNumeric(subforumcount) || !Utils.IsNumeric(displayorder)) { error = true; continue; } ForumInfo forumInfo = Forums.GetForumInfo(fid); forumInfo.Name = name; forumInfo.Subforumcount = int.Parse(subforumcount); forumInfo.Displayorder = int.Parse(displayorder); AdminForums.UpdateForumInfo(forumInfo); row++; } Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UI/ForumListBoxOptions"); Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/ForumList"); if (error) { base.RegisterStartupScript("PAGE", "alert('某些记录取值不正确,未能被更新!');window.location.href='forum_forumsgrid.aspx';"); } else { base.RegisterStartupScript("PAGE", "window.location.href='forum_forumsgrid.aspx';"); } #endregion }
protected void Page_Load(object sender, EventArgs e) { if (DNTRequest.GetString("currentfid") != "") { if (!AdminForums.MovingForumsPos(DNTRequest.GetString("currentfid"), DNTRequest.GetString("targetfid"), DNTRequest.GetString("isaschildnode") == "1" ? true : false)) { base.RegisterStartupScript("", "<script>alert('当前版块下面有子版块,因此无法移动!');window.location.href='forum_forumsTree.aspx';</script>"); } AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "移动论坛版块", "移动论坛版块ID:" + DNTRequest.GetString("currentfid") + "到ID:" + DNTRequest.GetString("targetfid")); } if (!Page.IsPostBack) { DataTable dt = DatabaseProvider.GetInstance().GetForums(); ViewState["dt"] = dt; if (dt.Rows.Count == 0) { Server.Transfer("forum_AddFirstForum.aspx"); //如果版块表中没有任何版块, 则跳转到"添加第一个版块"页面. } else { AddTree(0, dt.Select("layer=0 AND [parentid]=0"), ""); str = "<script type=\"text/javascript\">\r\n var obj = [" + str; str = str.Substring(0, str.Length - 3); str += "];\r\n var newtree = new tree(\"newtree\",obj,\"reSetTree\");"; str += "</script>"; } ShowTreeLabel.Text = str; } }
protected void Page_Load(object sender, EventArgs e) { var fid = Request["currentfid"].ToInt(); if (fid > 0) { var tfid = Request["targetfid"].ToInt(); if (!AdminForums.MovingForumsPos(fid, tfid, Request["isaschildnode"].ToInt() == 1)) { base.RegisterStartupScript("", "<script>alert('当前版块下面有子版块,因此无法移动!');window.location.href='forum_forumsTree.aspx';</script>"); } AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "移动论坛版块", "移动论坛版块ID:" + fid + "到ID:" + tfid); } if (!this.Page.IsPostBack) { var list = XForum.Root.Childs; if (list.Count == 0) { base.Server.Transfer("forum_AddFirstForum.aspx"); } else { this.AddTree(0, list, ""); this.str = "<script type=\"text/javascript\">\r\n var obj = [" + this.str; this.str = this.str.Substring(0, this.str.Length - 3); this.str += "];\r\n var newtree = new tree(\"newtree\",obj,\"reSetTree\");"; this.str += "</script>"; } this.ShowTreeLabel.Text = this.str; } }
private void SaveForum_Click(object sender, EventArgs e) { int num = -1; bool flag = false; foreach (object current in this.DataGrid1.GetKeyIDArray()) { int fid = int.Parse(current.ToString()); string text = this.DataGrid1.GetControlValue(num, "name").Trim(); //string text2 = this.DataGrid1.GetControlValue(num, "subforumcount").Trim(); string text3 = this.DataGrid1.GetControlValue(num, "displayorder").Trim(); if (String.IsNullOrEmpty(text) || !Utils.IsNumeric(text3)) { flag = true; } else { var forumInfo = Forums.GetForumInfo(fid); forumInfo.Name = text; //forumInfo.SubforumCount = int.Parse(text2); forumInfo.DisplayOrder = int.Parse(text3); AdminForums.UpdateForumInfo(forumInfo); num++; } } XCache.Remove(CacheKeys.FORUM_UI_FORUM_LIST_BOX_OPTIONS); XCache.Remove(CacheKeys.FORUM_FORUM_LIST); if (flag) { base.RegisterStartupScript("PAGE", "alert('某些记录取值不正确,未能被更新!');window.location.href='forum_forumsgrid.aspx';"); return; } base.RegisterStartupScript("PAGE", "window.location.href='forum_forumsgrid.aspx';"); }
private void SysteAutoSet_Click(object sender, EventArgs e) { if (base.CheckCookie()) { //AdminForums.SetForumslayer(); AdminForums.SetForumsSubForumCountAndDispalyorder(); //AdminForums.SetForumsPathList(); //AdminForums.SetForumsStatus(); // 修正论坛数据 var list = XForum.Root.AllChilds; //foreach (var item in list) //{ // item.Layer = item.Deepth; //} foreach (var item in list) { // 所有非顶级论坛,都让它的子孙跟随它隐藏 if (item.Layer > 0 && !item.Visible) { foreach (var elm in item.Childs) { elm.Visible = item.Visible; } } } // 统一保存 list.Save(); Caches.ReSetForumLinkList(); Caches.ReSetForumList(); Caches.ReSetForumListBoxOptions(); base.RegisterStartupScript("", "<script language=javascript>clearflag();</script>"); } }
private void AddIncoInfo_Click(object sender, EventArgs e) { if (base.CheckCookie()) { AdminForums.CreateSmilies(this.displayorder.Text.ToInt(0), 1, this.code.Text, this.url.UpdateFile(), this.userid, this.username, this.usergroupid, this.grouptitle, this.ip); base.RegisterStartupScript("PAGE", "window.location.href='forum_iconfilegrid.aspx';"); } }
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 }
private void AddSmileInfo_Click(object sender, EventArgs e) { if (base.CheckCookie()) { var typeid = WebHelper.RequestInt("typeid"); var sm = Smilie.FindByID(typeid); AdminForums.CreateSmilies(int.Parse(this.displayorder.Text), typeid, this.code.Text, sm.Url + "/" + this.url.UpdateFile(), this.userid, this.username, this.usergroupid, this.grouptitle, this.ip); base.RegisterStartupScript("PAGE", "window.location.href='forum_smilegrid.aspx?typeid=" + typeid + "';"); } }
private void SetForumsTrade(int fid) { ForumInfo foruminfo = AdminForums.GetForumInfo(fid); int isexist = DbProvider.GetInstance().GetCategoriesFidCount(fid) != 0 ? 1 : 0; if (foruminfo.Istrade != isexist) { foruminfo.Istrade = isexist; AdminForums.UpdateForumInfo(foruminfo); } }
private void SaveInfo_Click(object sender, EventArgs e) { #region 保存信息 if (this.CheckCookie()) { string resultMessage = ""; if (EnableSpace.SelectedValue == "1" && !Databases.IsExistTable("spaceconfigs")) { resultMessage = "您未能正确安装空间插件的数据库表"; } if (EnableAlbum.SelectedValue == "1" && !Databases.IsExistTable("albums")) { resultMessage += (resultMessage != "" ? "\\r\\n" : "") + "您未能正确安装相册插件的数据库表"; } if (resultMessage != "") { base.RegisterStartupScript("", "<script>alert('" + resultMessage + "');location.href=location.href;</script>"); return; } GeneralConfigInfo configInfo = GeneralConfigs.GetConfig(); configInfo.Forumtitle = forumtitle.Text; configInfo.Webtitle = webtitle.Text; configInfo.Weburl = weburl.Text; configInfo.Licensed = TypeConverter.StrToInt(licensed.SelectedValue); configInfo.Icp = icp.Text; configInfo.Debug = TypeConverter.StrToInt(debug.SelectedValue); configInfo.Statcode = Statcode.Text; configInfo.Linktext = Linktext.Text; configInfo.Spacename = spacename.Text; configInfo.Albumname = albumname.Text; configInfo.Closed = TypeConverter.StrToInt(closed.SelectedValue); configInfo.Closedreason = closedreason.Text; configInfo.Enablespace = Convert.ToInt32(EnableSpace.SelectedValue); configInfo.Enablealbum = Convert.ToInt32(EnableAlbum.SelectedValue); //configInfo.Enablemall = Convert.ToInt32(EnableMall.SelectedValue); //bool message = Databases.IsExistTable("albums"); GeneralConfigs.Serialiaze(configInfo, Server.MapPath("../../config/general.config")); if (configInfo.Aspxrewrite == 1) { AdminForums.SetForumsPathList(true, configInfo.Extname); } else { AdminForums.SetForumsPathList(false, configInfo.Extname); } Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/ForumList"); Discuz.Forum.TopicStats.SetQueueCount(); Caches.ReSetConfig(); AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "站点设置", ""); base.RegisterStartupScript("PAGE", "window.location.href='global_siteset.aspx';"); } #endregion }
public void BindPower_Click(object sender, EventArgs e) { #region 特殊用户绑定 if (UserList.Text != "") { string result = forumInfo.Permuserlist; string[] userpowerlist = new string[1] { "" }; if (result != null) { userpowerlist = forumInfo.Permuserlist.Split('|'); } foreach (string adduser in UserList.Text.Split(',')) { string uid = Discuz.Forum.Users.GetUserId(adduser).ToString(); if (uid == "-1") { continue; } bool find = false; foreach (string u in userpowerlist) { if (u.IndexOf(adduser + ",") == 0) { result = result.Replace(u, adduser + "," + uid + "," + 0); find = true; break; } } if (!find) { result = adduser + "," + uid + "," + 0 + "|" + result; } } if (result != "") { if (result.Substring(result.Length - 1, 1) == "|") { result = result.Substring(0, result.Length - 1); } } forumInfo.Permuserlist = result; AdminForums.UpdateForumInfo(forumInfo); UserList.Text = ""; } DataGridBind(""); BindTopicType(); this.TabControl1.SelectedIndex = 3; #endregion }
private void AddIncoInfo_Click(object sender, EventArgs e) { #region 添加图标记录 if (this.CheckCookie()) { AdminForums.CreateSmilies(Utils.StrToInt(displayorder.Text, 0), 1, code.Text, url.UpdateFile(), userid, username, usergroupid, grouptitle, ip); base.RegisterStartupScript("PAGE", "window.location.href='forum_iconfilegrid.aspx';"); } #endregion }
public void BindPower_Click(object sender, EventArgs e) { if (this.UserList.Text != "") { string text = this.forumInfo.Permuserlist; string[] array = new string[] { "" }; if (text != null) { array = this.forumInfo.Permuserlist.Split('|'); } string[] array2 = this.UserList.Text.Split(','); for (int i = 0; i < array2.Length; i++) { string text2 = array2[i]; string text3 = Users.GetUserId(text2).ToString(); if (!(text3 == "-1")) { bool flag = false; string[] array3 = array; for (int j = 0; j < array3.Length; j++) { string text4 = array3[j]; if (text4.IndexOf(text2 + ",") == 0) { text = text.Replace(text4, text2 + "," + text3 + "," + 0); flag = true; break; } } if (!flag) { text = text2 + "," + text3 + "," + 0 + "|" + text; } } } if (text != "" && text.Substring(text.Length - 1, 1) == "|") { text = text.Substring(0, text.Length - 1); } this.forumInfo.Permuserlist = text; AdminForums.UpdateForumInfo(this.forumInfo); this.UserList.Text = ""; } this.DataGridBind(""); this.BindTopicType(); this.TabControl1.SelectedIndex = 3; }
private void DelRec_Click(object sender, EventArgs e) { if (base.CheckCookie()) { if (Request["id"] != "") { string @string = Request["id"]; AdminForums.DeleteSmilies(@string, this.userid, this.username, this.usergroupid, this.grouptitle, this.ip); base.Response.Redirect("forum_smilegrid.aspx?typeid=" + DNTRequest.GetInt("typeid", 0)); return; } base.RegisterStartupScript("", "<script>alert('您未选中任何选项');window.location.href='forum_smilegrid.aspx?typeid=" + DNTRequest.GetInt("typeid", 0) + "';</script>"); } }
private DataTable buildGridData() { #region 数据绑定 DataTable dt = AdminForums.GetAllForumList(); foreach (DataRow dr in dt.Rows) { dr["parentidlist"] = dr["parentidlist"].ToString().Trim(); dr["name"] = dr["name"].ToString().Trim().Replace("\"", "'"); } return(dt); #endregion }
private void AddSmileInfo_Click(object sender, EventArgs e) { #region 添加表情记录 if (this.CheckCookie()) { AdminForums.CreateSmilies(int.Parse(displayorder.Text), DNTRequest.GetInt("typeid", 0), code.Text, Forum.Smilies.GetSmiliesTypeById(DNTRequest.GetInt("typeid", 0)).Url + "/" + url.UpdateFile(), userid, username, usergroupid, grouptitle, ip ); base.RegisterStartupScript("PAGE", "window.location.href='forum_smilegrid.aspx?typeid=" + DNTRequest.GetInt("typeid", 0) + "';"); } #endregion }
private void SaveMoveInfo_Click(object sender, EventArgs e) { if (this.sourceforumid.SelectedValue == this.targetforumid.SelectedValue) { base.RegisterStartupScript("", "<script>alert('您所要移动的版块与目标版块相同, 因此无法提交!');</script>"); return; } bool isaschildnode = this.movetype.SelectedValue == "1"; if (!AdminForums.MovingForumsPos(this.sourceforumid.SelectedValue.ToInt(), this.targetforumid.SelectedValue.ToInt(), isaschildnode)) { base.RegisterStartupScript("", "<script>alert('当前源版块移动失败!');</script>"); return; } ForumOperator.RefreshForumCache(); AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "移动论坛版块", "移动论坛版块ID:" + this.sourceforumid.SelectedValue + "到ID:" + this.targetforumid.SelectedValue); base.RegisterStartupScript("PAGE", "window.location.href='forum_forumsTree.aspx';"); }
public void DelButton_Click(object sender, EventArgs e) { int num = 0; ArrayList arrayList = new ArrayList(this.forumInfo.Permuserlist.Split('|')); foreach (object current in this.SpecialUserList.GetKeyIDArray()) { if (this.SpecialUserList.GetCheckBoxValue(num, "userid")) { string str = current.ToString(); string[] array = this.forumInfo.Permuserlist.Split('|'); for (int i = 0; i < array.Length; i++) { string text = array[i]; if (text.IndexOf("," + str + ",") > 0) { arrayList.Remove(text); break; } } } num++; } string text2 = ""; foreach (string str2 in arrayList) { text2 = text2 + str2 + "|"; } if (text2 != "") { text2 = text2.Substring(0, text2.Length - 1); } this.forumInfo.Permuserlist = text2; AdminForums.UpdateForumInfo(this.forumInfo); if (this.SpecialUserList.Items.Count == 1 && this.SpecialUserList.CurrentPageIndex > 0) { this.SpecialUserList.CurrentPageIndex--; } this.DataGridBind(""); this.BindTopicType(); this.TabControl1.SelectedIndex = 3; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { #region FID删除相应的版块 if (AdminForums.DeleteForumsByFid(DNTRequest.GetString("fid"))) { AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "删除论坛版块", "删除论坛版块,fid为:" + DNTRequest.GetString("fid")); base.RegisterStartupScript("", "<script>window.location.href='forum_ForumsTree.aspx';</script>"); } else { base.RegisterStartupScript("", "<script>alert('对不起,当前节点下面还有子结点,因此不能删除!');window.location.href='forum_ForumsTree.aspx';</script>"); } #endregion } }
private void SysteAutoSet_Click(object sender, EventArgs e) { #region 系统调整论坛版块 if (this.CheckCookie()) { AdminForums.SetForumslayer(); AdminForums.SetForumsSubForumCountAndDispalyorder(); AdminForums.SetForumsPathList(); AdminForums.SetForumsStatus(); AdminCaches.ReSetForumLinkList(); AdminCaches.ReSetForumList(); AdminCaches.ReSetForumListBoxOptions(); base.RegisterStartupScript("", "<script language=javascript>clearflag();</script>"); } #endregion }
private void SaveCombinationInfo_Click(object sender, EventArgs e) { #region 合并论坛版块 if (this.CheckCookie()) { if (sourceforumid.SelectedValue == "0") { base.RegisterStartupScript("", "<script>alert('请选择相应的源论坛!');</script>"); return; } if (targetforumid.SelectedValue == "0") { base.RegisterStartupScript("", "<script>alert('请选择相应的目标论坛!');</script>"); return; } ForumInfo forumInfo = Forums.GetForumInfo(Utils.StrToInt(targetforumid.SelectedValue, 0)); if (forumInfo != null && forumInfo.Parentid == 0 && forumInfo.Layer == 0) { base.RegisterStartupScript("", "<script>alert('您所选择的目标论坛是\"论坛分类\"而不是\"论坛版块\",因此合并无效!');</script>"); return; } string result; if (!AdminForums.CombinationForums(sourceforumid.SelectedValue, targetforumid.SelectedValue)) { result = "<script>alert('当前节点下面有子结点,因此合并无效!');window.location.href='forum_forumcombination.aspx';</script>"; base.RegisterStartupScript("", result); return; } else { AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "合并论坛版块", "合并论坛版块" + sourceforumid.SelectedValue + "到" + targetforumid.SelectedValue); base.RegisterStartupScript("PAGE", "window.location.href='forum_forumstree.aspx';"); return; } } #endregion }
private void SaveInfo_Click(object sender, EventArgs e) { #region 保存设置信息 if (this.CheckCookie()) { GeneralConfigInfo configInfo = GeneralConfigs.GetConfig(); configInfo.Seotitle = seotitle.Text; configInfo.Seokeywords = seokeywords.Text; configInfo.Seodescription = seodescription.Text; configInfo.Seohead = seohead.Text; configInfo.Archiverstatus = Convert.ToInt16(archiverstatus.SelectedValue); configInfo.Sitemapstatus = Convert.ToInt16(sitemapstatus.SelectedValue); configInfo.Sitemapttl = Convert.ToInt32(sitemapttl.Text); configInfo.Aspxrewrite = Convert.ToInt16(aspxrewrite.SelectedValue); if (extname.Text.Trim() == "") { base.RegisterStartupScript("", "<script>alert('您未输入相应的伪静态url扩展名!');</script>"); return; } configInfo.Extname = extname.Text.Trim(); if (configInfo.Aspxrewrite == 1) { AdminForums.SetForumsPathList(true, configInfo.Extname); } else { AdminForums.SetForumsPathList(false, configInfo.Extname); } Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/ForumList"); configInfo.Iisurlrewrite = Convert.ToInt16(iisurlrewrite.SelectedValue); GeneralConfigs.Serialiaze(configInfo, Server.MapPath("../../config/general.config")); AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "搜索引擎优化设置", ""); base.RegisterStartupScript("PAGE", "window.location.href='global_searchengine.aspx';"); } #endregion }
private void DelRec_Click(object sender, EventArgs e) { #region 除指定的表情记录 if (this.CheckCookie()) { if (DNTRequest.GetString("id") != "") { string idlist = DNTRequest.GetString("id"); AdminForums.DeleteSmilies(idlist, userid, username, usergroupid, grouptitle, ip); Response.Redirect("forum_smilegrid.aspx?typeid=" + DNTRequest.GetInt("typeid", 0)); } else { base.RegisterStartupScript("", "<script>alert('您未选中任何选项');window.location.href='forum_smilegrid.aspx?typeid=" + DNTRequest.GetInt("typeid", 0) + "';</script>"); } } #endregion }
public void DelButton_Click(object sender, EventArgs e) { #region 除特殊用户 int row = 0; ArrayList al = new ArrayList(forumInfo.Permuserlist.Split('|')); foreach (object o in SpecialUserList.GetKeyIDArray()) { if (SpecialUserList.GetCheckBoxValue(row, "userid")) { string uid = o.ToString(); foreach (string user in forumInfo.Permuserlist.Split('|')) { if (user.IndexOf("," + uid + ",") > 0) { al.Remove(user); break; } } } row++; } string result = ""; foreach (string user in al) { result += user + "|"; } if (result != "") { result = result.Substring(0, result.Length - 1); } forumInfo.Permuserlist = result; AdminForums.UpdateForumInfo(forumInfo); if (SpecialUserList.Items.Count == 1 && SpecialUserList.CurrentPageIndex > 0) { SpecialUserList.CurrentPageIndex--; } DataGridBind(""); BindTopicType(); this.TabControl1.SelectedIndex = 3; #endregion }
private void SaveInfo_Click(object sender, EventArgs e) { #region 保存信息 if (this.CheckCookie()) { GeneralConfigInfo configInfo = GeneralConfigs.GetConfig(); configInfo.Forumtitle = forumtitle.Text; configInfo.Webtitle = webtitle.Text; configInfo.Weburl = weburl.Text; configInfo.Licensed = TypeConverter.StrToInt(licensed.SelectedValue); configInfo.Icp = icp.Text; configInfo.Debug = TypeConverter.StrToInt(debug.SelectedValue); configInfo.Statcode = Statcode.Text; configInfo.Linktext = Linktext.Text; configInfo.Spacename = spacename.Text; configInfo.Albumname = albumname.Text; configInfo.Closed = TypeConverter.StrToInt(closed.SelectedValue); configInfo.Closedreason = closedreason.Text; configInfo.Enablespace = Convert.ToInt32(EnableSpace.SelectedValue); configInfo.Enablealbum = Convert.ToInt32(EnableAlbum.SelectedValue); configInfo.Enablemall = Convert.ToInt32(EnableMall.SelectedValue); GeneralConfigs.Serialiaze(configInfo, Server.MapPath("../../config/general.config")); Urls.config = configInfo; if (configInfo.Aspxrewrite == 1) { AdminForums.SetForumsPathList(true, configInfo.Extname); } else { AdminForums.SetForumsPathList(false, configInfo.Extname); } Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/ForumList"); Discuz.Forum.TopicStats.SetQueueCount(); Caches.ReSetConfig(); AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "站点设置", ""); base.RegisterStartupScript("PAGE", "window.location.href='global_siteset.aspx';"); } #endregion }