private void LoadWebSiteConfig() { XmlDocumentExtender xmlDocumentExtender = new XmlDocumentExtender(); xmlDocumentExtender.Load(this.configPath); XmlNodeList xmlNodeList = xmlDocumentExtender.SelectNodes("/Aggregationinfo/Aggregationdata/Websiteaggregationdata/Topiclist/Topic"); XmlNodeList xmlNodeList2 = xmlDocumentExtender.SelectNodes("/Aggregationinfo/Aggregationpage/Website/Forum/Topiclist/Topic"); XmlNodeInnerTextVisitor xmlNodeInnerTextVisitor = new XmlNodeInnerTextVisitor(); XmlNodeInnerTextVisitor xmlNodeInnerTextVisitor2 = new XmlNodeInnerTextVisitor(); this.forumlist.Text = ""; int num = 0; foreach (XmlNode node in xmlNodeList) { xmlNodeInnerTextVisitor.SetNode(node); bool flag = false; foreach (XmlNode node2 in xmlNodeList2) { xmlNodeInnerTextVisitor2.SetNode(node2); if (xmlNodeInnerTextVisitor["topicid"].ToString() == xmlNodeInnerTextVisitor2["topicid"].ToString()) { flag = true; break; } } Literal expr_E4 = this.forumlist; object text = expr_E4.Text; expr_E4.Text = text + "<div class='mo' id='m" + num + "' flag='f" + num + "'><h1><input type='checkbox' name='tid' " + (flag ? "checked" : "") + " value='" + xmlNodeInnerTextVisitor["topicid"] + "'>" + xmlNodeInnerTextVisitor["title"] + "</h1></div>\n"; num++; } this.topnumber.Text = xmlDocumentExtender.GetSingleNodeValue(xmlDocumentExtender.SelectNodes("/Aggregationinfo/Aggregationpage/Website/Forum")[0], "Bbs/Topnumber"); this.showtype.SelectedValue = xmlDocumentExtender.GetSingleNodeValue(xmlDocumentExtender.SelectNodes("/Aggregationinfo/Aggregationpage/Website/Forum")[0], "Bbs/Showtype"); }
/// <summary> /// 装载WebSite信息 /// </summary> private void LoadWebSiteConfig() { #region 装载主题信息 XmlDocumentExtender doc = new XmlDocumentExtender(); doc.Load(configPath); XmlNodeList topiclistNode = doc.SelectNodes("/Aggregationinfo/Aggregationdata/Websiteaggregationdata/Topiclist/Topic"); XmlNodeList website_spacelistnode = doc.SelectNodes("/Aggregationinfo/Aggregationpage/Website/Forum/Topiclist/Topic"); XmlNodeInnerTextVisitor topicvisitor = new XmlNodeInnerTextVisitor(); XmlNodeInnerTextVisitor pagetopicvisitor = new XmlNodeInnerTextVisitor(); forumlist.Text = ""; int i = 0; foreach (XmlNode topic in topiclistNode) { topicvisitor.SetNode(topic); bool isCheck = false; foreach (XmlNode index in website_spacelistnode) { pagetopicvisitor.SetNode(index); if (topicvisitor["topicid"].ToString() == pagetopicvisitor["topicid"].ToString()) { isCheck = true; break; } } forumlist.Text += "<div class='mo' id='m" + i + "' flag='f" + i + "'><h1><input type='checkbox' name='tid' " + (isCheck ? "checked" : "") + " value='" + topicvisitor["topicid"] + "'>" + topicvisitor["title"] + "</h1></div>\n"; i++; } topnumber.Text = doc.GetSingleNodeValue(doc.SelectNodes("/Aggregationinfo/Aggregationpage/Website/Forum")[0], "Bbs/Topnumber"); showtype.SelectedValue = doc.GetSingleNodeValue(doc.SelectNodes("/Aggregationinfo/Aggregationpage/Website/Forum")[0], "Bbs/Showtype"); #endregion }
/// <summary> /// 获取聚合首页自动推荐主题列表的排序规则 /// </summary> /// <returns></returns> public TopicOrderType GetForumAggregationTopicListOrder() { if (topicOrderType == null) { XmlDocumentExtender doc = new XmlDocumentExtender(); doc.Load(Utils.GetMapPath(BaseConfigs.GetForumPath + "config/aggregation.config")); topicOrderType = (TopicOrderType)TypeConverter.ObjectToInt(doc.GetSingleNodeValue(doc.SelectNodes("/Aggregationinfo/Aggregationpage/Website/Forum")[0], "Bbs/Showtype")); } return((TopicOrderType)topicOrderType); }
protected string GetRotatePicStr(string nodeName) { xmlDoc.Load(filepath); var xmlNodeList = xmlDoc.DocumentElement.SelectNodes("/Aggregationinfo/Aggregationpage/" + nodeName + "/" + nodeName + "_rotatepiclist/" + nodeName + "_rotatepic"); var sb = new StringBuilder(); for (int i = 0; i < xmlNodeList.Count; i++) { sb.Append("data[\"-1_" + (i + 1) + "\"] = \"img: " + xmlDoc.GetSingleNodeValue(xmlNodeList[i], "img").Replace("\"", "\\\"") + "; url: " + xmlDoc.GetSingleNodeValue(xmlNodeList[i], "url").Replace("\"", "\\\"") + "; target: _blank; alt:" + xmlDoc.GetSingleNodeValue(xmlNodeList[i], "titlecontent").Replace("\"", "\\\"") + " ; titlecontent: " + xmlDoc.GetSingleNodeValue(xmlNodeList[i], "titlecontent").Replace("\"", "\\\"") + ";\"\r\n"); } return(sb.ToString().Trim()); }
private void LoadWebSiteConfig() { #region 绑定自动推荐相册 //装载配置文件 XmlDocumentExtender doc = new XmlDocumentExtender(); doc.Load(configPath); XmlNode albumconfig = doc.SelectSingleNode("/Aggregationinfo/Aggregationpage/Albumindex/Albumconfig"); focusphotoshowtype.SelectedIndex = Convert.ToInt32(doc.GetSingleNodeValue(albumconfig, "Focusphotoshowtype")); focusphotodays.Text = doc.GetSingleNodeValue(albumconfig, "Focusphotodays"); focusphotocount.Text = doc.GetSingleNodeValue(albumconfig, "Focusphotocount"); recommendalbumtype.SelectedIndex = Convert.ToInt32(doc.GetSingleNodeValue(albumconfig, "Focusalbumshowtype")); focusalbumdays.Text = doc.GetSingleNodeValue(albumconfig, "Focusalbumdays"); focusalbumcount.Text = doc.GetSingleNodeValue(albumconfig, "Focusalbumcount"); weekhot.Text = doc.GetSingleNodeValue(albumconfig, "Weekhot"); #endregion }