protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { LoadTheme(themecode, siteid, languagecode, pcode); CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_Article'"); id = Rint_Para("0"); parentnode = Node("Info"); pageindex = RequestTool.RequestInt("page", 1); node = B_Lebi_Node.GetModel(id); nodes = B_Lebi_Node.GetList("parentid=" + parentnode.id + " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'", "Sort desc,id desc"); if (node == null) { node = nodes.FirstOrDefault(); } path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">»</em><a href=\"" + URL("P_Article", "") + "\"><span>" + Tag(parentnode.Name) + "</span></a>"; if (node != null) { path += "<em>»</em><a href=\"" + URL("P_Article", node.id) + "\"><span>" + node.Name + "</span></a>"; } if (node == null) { node = new Lebi_Node(); } string where = "Node_id=" + node.id + " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'"; pages = B_Lebi_Page.GetList(where, "Sort desc,id desc", PageSize, pageindex); recordCount = B_Lebi_Page.Counts(where); PageString = Shop.Bussiness.Pager.GetPaginationStringForWeb("?id=" + id + "&page={0}", pageindex, PageSize, recordCount, CurrentLanguage); FootPage = PageString; NextPage = "?id=" + id + "&page=" + (pageindex + 1) + ""; }
/// <summary> /// 删除自定义结点 /// </summary> public void UserNode_Del() { if (!EX_Admin.Power("node_del", "删除自定义结点")) { EX_Admin.NoPower(); return; } string ids = RequestTool.RequestString("ids"); string PageCode = RequestTool.RequestString("PageCode"); if (ids != "") { List <Lebi_Node> nodes = B_Lebi_Node.GetList("id in (lbsql{" + ids + "})", ""); foreach (Lebi_Node node in nodes) { B_Lebi_Node.Delete("id=" + node.id + " or parentid=" + node.id + ""); B_Lebi_Page.Delete("Node_id=" + node.id + ""); } string action = Tag("删除自定义结点"); string description = ""; Log.Add(action, "Node", ids, CurrentAdmin, description); } if (PageCode == "P_Help") { Lebi_Theme_Page themepage = B_Lebi_Theme_Page.GetModel("Code='P_Help'"); if (themepage.Type_id_PublishType == 122) { PageStatic.Greate_Help(themepage); } } Response.Write("{\"msg\":\"OK\"}"); }
public string GetTreeString(int parentID, int deep) { string str = ""; List <Lebi_Node> nodes = B_Lebi_Node.GetList("parentid=" + parentID + "", "Sort desc"); if (nodes.Count > 0) { foreach (Lebi_Node node in nodes) { str += "<tr class=\"list\" onDblClick=\"Node_Edit(0," + node.id + ")\">"; str += "<td><strong>"; str += node.Code; str += "</strong></td>"; str += "<td>" + node.Sort + "</td>"; if (deep == 0) { str += "<td><strong>" + node.Name + "</strong></td>"; } else { str += "<td>" + GetDeep("<label class=\"subFlag\">┗</label>" + node.Name, deep) + "</td>"; } str += "<td>"; str += NodePage.NodeType(node.TypeFlag); str += "</td>"; str += "<td>"; str += (node.IsLanguages == 1?"Yes":"No"); str += "</td>"; str += "<td>"; str += B_Lebi_Page.Counts("node_id=" + node.id + "").ToString(); str += "</td>"; str += "<td>"; //str += "<a href=\"#\" onclick=\"UpdateNode(" + node.ParentNodeID + ",0);\">" + Tag("创建同级结点") + "</a>"; //str += "<span class=\"editSep\">|</span>"; str += "<a href=\"#\" onclick=\"Node_Edit(0," + node.id + ");\">" + Tag("修改") + "</a>"; str += " | "; str += "<a href=\"#\" onclick=\"Node_Del(" + node.id + ");\">" + Tag("删除") + "</a>"; if (node.haveson == 1) { str += " | "; str += "<a href=\"#\" onclick=\"Node_Edit(" + node.id + ",0);\">" + Tag("创建子结点") + "</a>"; } str += "</td>"; str += "</tr>"; str += GetTreeString(node.id, deep + 1); } //str += "</ul> \r\n"; } return(str); }
/// <summary> /// 文章分类 /// </summary> /// <returns></returns> public string Article() { Lebi_Node node = NodePage.GetNodeByCode("Info"); List <Lebi_Node> nodes = B_Lebi_Node.GetList("parentid=" + node.id + "", ""); string str = "<tr><th>" + Tag("类别") + ":</th><td>"; foreach (Lebi_Node n in nodes) { str += "<input type=\"checkbox\" name=\"node\" value=\"" + n.id + "\" shop=\"true\" >" + n.Name + "</br>"; } str += "</td></tr>"; return(str); }
/// <summary> /// 递归生成下拉菜单 /// </summary> /// <param name="depth"></param> /// <param name="parentID"></param> /// <param name="nodeID"></param> /// <returns></returns> public string GetOptionTreeString(int depth, int parentID, int nodeID) { StringBuilder builderTree = new StringBuilder(); //DataRow[] drs = dtNodes.Select(string.Format("ParentNodeID={0}", parentID)); List <Lebi_Node> nodes = new List <Lebi_Node>(); nodes = B_Lebi_Node.GetList("parentid=" + parentID + "", ""); if (nodes.Count > 0) { foreach (Lebi_Node node in nodes) { builderTree.Append(string.Format("<option value=\"{0}\" {1}>{2}{3}</option> \r\n", node.id.ToString(), node.id == nodeID ? "selected=\"selected\"" : "", GetPrefixString(depth), node.Name)); builderTree.Append(GetOptionTreeString(depth + 1, node.id, nodeID)); } } return(builderTree.ToString()); }
/// <summary> /// 帮助中心页面 /// </summary> /// <param name="lang"></param> /// <param name="model"></param> /// <param name="theme"></param> /// <param name="urlpath"></param> private void P_Help(List <Lebi_Language> langs, Lebi_Theme_Page model, string urlpath) { string url; Lebi_Node pnode = NodePage.GetNodeByCode("Help"); string file = ""; int pageindex = RequestTool.RequestInt("pageindex", 0); int pagesize = RequestTool.RequestInt("pagesize", 0); string where = "parentid=" + pnode.id + ""; List <Lebi_Node> nodes = B_Lebi_Node.GetList(where, "", pagesize, pageindex); int count = B_Lebi_Node.Counts(where); int pagecount = Pager.GetPageCount(pagesize, count); int per = 100; if (pagecount > 0) { per = Convert.ToInt32(pageindex * 100 / pagecount); } List <Lebi_Site> sites = GetSites(); Lebi_Site site; foreach (Lebi_Node node in nodes) { foreach (Lebi_Language lang in langs) { if (node.Language.ToLower().Contains(lang.Code.ToLower())) { site = GetSite(sites, lang.Site_id); file = site.Path + "/" + lang.Path + "/" + model.StaticPath + "/" + model.StaticPageName; file = file.Replace("{0}", node.id.ToString()); file = RegexTool.ReplaceRegValue(file, @"{.*?}", ""); file = ThemeUrl.CheckPath(file); url = model.PageName + "?" + model.PageParameter; url = url.Replace("{0}", node.id.ToString()); url = urlpath + "/" + site.Path + "/" + lang.Path + "/" + url; url = RegexTool.ReplaceRegValue(url, @"{.*?}", ""); url = ThemeUrl.CheckURL(url); HtmlEngine.Instance.CreatHtml(url, file); } } } Response.Write("{\"msg\":\"OK\",\"per\":\"" + per + "\"}"); }
public string GetTreeString(int parentID, int deep) { string str = ""; List <Lebi_Node> nodes = B_Lebi_Node.GetList("parentid=" + parentID + "", "Sort desc"); if (nodes.Count > 0) { foreach (Lebi_Node node in nodes) { if (Topnode.IsLanguages == 1) { node.Name = Lang(node.Name); } str += "<tr class=\"list\" onDblClick=\"Node_Edit(0," + node.id + ")\">"; str += "<td style=\"text-align:center\"><input type=\"checkbox\" name=\"ids\" del=\"true\" value=\"" + node.id + "\" /></td>"; str += "<td>" + node.id + "</td>"; str += "<td>" + node.Sort + "</td>"; if (deep == 0) { str += "<td><strong>" + node.Name + "</strong></td>"; } else { str += "<td>" + GetDeep("<label class=\"subFlag\">┗</label>" + node.Name, deep) + "</td>"; } str += "<td>"; str += "<a href=\"#\" onclick=\"Node_Edit(0," + node.id + ");\">" + Tag("编辑") + "</a>"; if (Topnode.haveson == 1) { str += " | <a href=\"#\" onclick=\"Node_Edit(" + node.id + ",0);\">" + Tag("创建子结点") + "</a>"; } str += "</td>"; str += "</tr>"; str += GetTreeString(node.id, deep + 1); } //str += "</ul> \r\n"; } return(str); }
protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { LoadTheme(themecode, siteid, languagecode, pcode); CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_ArticleDetails'"); id = Rint_Para("0"); parentnode = Node("Info"); nodes = B_Lebi_Node.GetList("Parentid=" + parentnode.id + " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'", "Sort desc"); page = B_Lebi_Page.GetModel(id); if (page == null) { node = nodes.FirstOrDefault(); page = NodePage.GetPageByNode(node); if (page == null) { PageError(); } } else { page.Count_Views += 1; B_Lebi_Page.Update(page); node = B_Lebi_Node.GetModel(page.Node_id); } string where = "Node_id=" + node.id + " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'"; PreviousPage = B_Lebi_Page.GetModel(where + " and Sort>=" + page.Sort + " and id>" + page.id + " order by Sort asc,id asc"); NextPage = B_Lebi_Page.GetModel(where + " and Sort<=" + page.Sort + " and id<" + page.id + " order by Sort desc,id desc"); if (PreviousPage == null) { PreviousPage = new Lebi_Page(); } if (NextPage == null) { NextPage = new Lebi_Page(); } path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">»</em><a href=\"" + URL("P_Article", "") + "\"><span>" + Tag(parentnode.Name) + "</span></a><em>»</em><a href=\"" + URL("P_Article", node.id) + "\"><span>" + node.Name + "</span></a><em>»</em><a href=\"" + URL("P_ArticleDetails", page.id) + "\"><span>" + page.Name + "</span></a>"; }
/// <summary> /// 文章列表页面 /// </summary> /// <param name="lang"></param> /// <param name="model"></param> /// <param name="theme"></param> /// <param name="urlpath"></param> private void P_Article(Lebi_Language lang, Lebi_Theme_Page model, Lebi_Theme theme, string urlpath) { string url; string nodeids = RequestTool.RequestString("node"); if (nodeids == null) { return; } string path = lang.Path + "/" + model.StaticPath + "/" + model.StaticPageName; string pathto = ""; List <Lebi_Node> nodes = B_Lebi_Node.GetList("id in (lbsql{" + nodeids + "}) and Language_Code like '%" + lang.Code + "%'", ""); foreach (Lebi_Node node in nodes) { url = model.PageName + "?" + model.PageParameter; url = url.Replace("{0}", node.id.ToString()); url = urlpath + "/" + url; pathto = path.Replace("{0}", node.id.ToString()); url = ThemeUrl.CheckURL(url); HtmlEngine.Instance.CreatHtml(url, pathto); } }
protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { LoadTheme(themecode, siteid, languagecode, pcode); CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_Help'"); id = Rint_Para("0"); pageid = Rint_Para("1"); type = Rstring("type"); parentnode = Node("Help"); nodes = B_Lebi_Node.GetList("Parentid=" + parentnode.id + " and ','+Language_ids+',' like '%," + CurrentLanguage.id + ",%'", "Sort desc"); if (id == 0 && type != "") { node = new Lebi_Node(); if (type == "agreement") { Name = Tag("注册协议"); Content = Lang(SYS.ServiceP).Replace("\n", "<br/>"); } node.Name = Name; path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">»</em><a href=\"" + URL("P_Help", "") + "\"><span>" + Tag(parentnode.Name) + "</span></a><em>»</em><a class=\"text\"><span>" + Tag(Name) + "</span></a>"; } else { node = B_Lebi_Node.GetModel(id); if (node == null) { node = nodes.FirstOrDefault(); if (node == null) { node = new Lebi_Node(); //PageError(); } else { id = node.id; } } //else //{ // if (node.id == id) // { // node = nodes.FirstOrDefault(); // } //} pages = B_Lebi_Page.GetList("Node_id=" + node.id + "", "id desc"); if (pages == null) { pages = new List <Lebi_Page>(); } path = "<a href=\"" + CurrentLanguage.Path + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">»</em><a href=\"" + URL("P_Help", "") + "\"><span>" + Tag(parentnode.Name) + "</span></a>"; page = B_Lebi_Page.GetModel("id=" + pageid + ""); if (page == null) { page = pages.FirstOrDefault(); if (pages.FirstOrDefault() == null) { pageid = 0; } else { pageid = page.id; } } else { path += "<em>»</em><a href=\"" + URL("P_Help", node.id) + "\"><span>" + node.Name + "</span></a><em>»</em><a class=\"text\"><span>" + page.Name + "</span></a>"; } //Help_Content.pages = pages; } }
public string GetTreeString(int parentID, int deep) { string str = ""; string where = "parentid=" + parentID + ""; if (lang != "") { where += " and Language Like lbsql{'%" + lang + "%'}"; } if (key != "") { where += " and [Name] like lbsql{'%" + key + "%'}"; } if (site.SiteCount > 1 && CurrentAdmin.Site_ids != "") { string sonwhere = ""; List <Lebi_Language> ls = B_Lebi_Language.GetList("Site_id in (" + CurrentAdmin.Site_ids + ")", ""); foreach (Lebi_Language l in ls) { if (sonwhere == "") { sonwhere = "','+Language_ids+',' like '%," + l.id + ",%'"; } else { sonwhere += " or ','+Language_ids+',' like '%," + l.id + ",%'"; } } if (sonwhere != "") { where += " and (" + sonwhere + " or Language_ids='')"; } } List <Lebi_Node> nodes = B_Lebi_Node.GetList(where, "Sort desc"); if (nodes.Count > 0) { foreach (Lebi_Node node in nodes) { str += "<tr class=\"list\" onDblClick=\"Node_Edit(0," + node.id + ")\">"; str += "<td style=\"text-align:center\"><input type=\"checkbox\" name=\"ids\" del=\"true\" value=\"" + node.id + "\" /></td>"; str += "<td>" + node.id + "</td>"; str += "<td><div class=\"more\" style=\"width: 80px;\" title=\"" + LanguageName(node.Language_ids) + "\">" + LanguageName(node.Language_ids) + "</div></td>"; if (deep == 0) { str += "<td><a href=\"" + NodePage.AdminIndexPage(node) + "\" >" + node.Name + "</a></td>"; } else { str += "<td>" + GetDeep("<label class=\"subFlag\">┗</label>" + node.Name, deep) + "</td>"; } str += "<td>"; str += B_Lebi_Page.Counts("node_id=" + node.id + "").ToString(); str += "</td>"; str += "<td>" + node.ShowMode + "</td>"; str += "<td>" + node.Sort + "</td>"; str += "<td style=\"text-align:left\">"; str += "<a href=\"#\" onclick=\"Node_Edit(0," + node.id + ");\">" + Tag("编辑") + "</a>"; if (node.haveson == 1) { str += "<span class=\"editSep\"> | </span>"; str += "<a href=\"#\" onclick=\"Node_Edit(" + node.id + ",0);\">" + Tag("创建子分类") + "</a>"; } else { str += " | "; str += "<a href=\"" + NodePage.AdminIndexPage(node) + "\" >" + Tag("进入") + "</a>"; } str += "</td>"; str += "</tr>"; str += GetTreeString(node.id, deep + 1); } //str += "</ul> \r\n"; } return(str); }
/// <summary> /// 递归生成下拉菜单 /// </summary> /// <param name="depth"></param> /// <param name="parentID"></param> /// <param name="nodeID"></param> /// <returns></returns> public string GetMenu(string url) { StringBuilder builderTree = new StringBuilder(); List <Lebi_Node> nodes = new List <Lebi_Node>(); Lebi_Node pnode; string[] arr = url.Split(':'); string code = ""; string value = ""; if (arr.Length > 1) { code = arr[0]; value = arr[1]; } string sel = ""; //添加自定义文章 pnode = NodePage.GetNodeByCode("Info", 0); if (code == "P_Article" && value == pnode.id.ToString()) { sel = "selected"; } builderTree.Append("<option code=\"P_Article\" value=\"\" " + sel + ">" + pnode.Name + "</option>"); nodes = B_Lebi_Node.GetList("parentid =" + pnode.id + "", ""); if (nodes.Count > 0) { foreach (Lebi_Node node in nodes) { sel = ""; if (code == "P_Article" && value == node.id.ToString()) { sel = "selected"; } builderTree.Append(string.Format("<option code=\"P_Article\" value=\"{0}\" " + sel + "> |- {1}</option> \r\n", node.id, node.Name)); } } //添加帮助中心 pnode = NodePage.GetNodeByCode("Help", 0); sel = ""; if (code == "P_Help" && value == pnode.id.ToString()) { sel = "selected"; } builderTree.Append("<option code=\"P_Help\" value=\"\" " + sel + ">" + pnode.Name + "</option>"); nodes = B_Lebi_Node.GetList("parentid =" + pnode.id + "", ""); if (nodes.Count > 0) { foreach (Lebi_Node node in nodes) { sel = ""; if (code == "P_Help" && value == node.id.ToString()) { sel = "selected"; } builderTree.Append(string.Format("<option code=\"P_Help\" value=\"{0}\" " + sel + "> |- {1}</option> \r\n", node.id, node.Name)); } } //添加公司介绍 pnode = NodePage.GetNodeByCode("About", 0); sel = ""; if (code == "P_About" && value == "0") { sel = "selected"; } builderTree.Append("<option code=\"P_About\" value=\"\" " + sel + ">" + pnode.Name + "</option>"); List <Lebi_Page> ps = B_Lebi_Page.GetList("Node_id =" + pnode.id + "", ""); if (ps.Count > 0) { foreach (Lebi_Page p in ps) { sel = ""; if (code == "P_About" && value == p.id.ToString()) { sel = "selected"; } builderTree.Append(string.Format("<option code=\"P_About\" value=\"{0}\" " + sel + "> |- {1}</option> \r\n", p.id, p.Name)); } } //添加商城动态 pnode = NodePage.GetNodeByCode("News", 0); sel = ""; if (code == "P_News" && value == pnode.id.ToString()) { sel = "selected"; } builderTree.Append(string.Format("<option code=\"P_News\" value=\"{0}\" " + sel + ">{1}</option> \r\n", pnode.id, pnode.Name)); //添加商品专题 //List<Lebi_Tab> ts = B_Lebi_Tab.GetList("", "Tsort desc"); //if (ts.Count > 0) //{ // foreach (Lebi_Tab t in ts) // { // sel = ""; // if (code == "P_Tab" && value == t.id.ToString()) // sel = "selected"; // builderTree.Append(string.Format("<option code=\"P_Tab\" value=\"{0}\" " + sel + ">[" + Tag("商品专题") + "]{1}</option> \r\n", t.id, Language.Content(t.Tname, CurrentLanguage))); // } //} sel = ""; if (code == "P_Index") { sel = "selected"; } builderTree.Append("<option code=\"P_Index\" value=\"\" " + sel + ">" + Tag("首页") + "</option>"); sel = ""; if (code == "P_Inquiry") { sel = "selected"; } builderTree.Append("<option code=\"P_Inquiry\" value=\"\" " + sel + ">" + Tag("留言反馈") + "</option>"); sel = ""; if (code == "P_LimitBuy") { sel = "selected"; } builderTree.Append("<option code=\"P_LimitBuy\" value=\"\" " + sel + ">" + Tag("限时抢购") + "</option>"); sel = ""; if (code == "P_GroupPurchase") { sel = "selected"; } builderTree.Append("<option code=\"P_GroupPurchase\" value=\"\" " + sel + ">" + Tag("团购") + "</option>"); sel = ""; if (code == "P_Exchange") { sel = "selected"; } builderTree.Append("<option code=\"P_Exchange\" value=\"\" " + sel + ">" + Tag("积分换购") + "</option>"); sel = ""; if (code == "P_AllProductCategories") { sel = "selected"; } builderTree.Append("<option code=\"P_AllProductCategories\" value=\"\" " + sel + ">" + Tag("全部商品分类") + "</option>"); sel = ""; if (code == "P_Basket") { sel = "selected"; } builderTree.Append("<option code=\"P_Basket\" value=\"\" " + sel + ">" + Tag("购物车") + "</option>"); sel = ""; if (code == "P_FriendLink") { sel = "selected"; } builderTree.Append("<option code=\"P_FriendLink\" value=\"\" " + sel + ">" + Tag("友情链接") + "</option>"); sel = ""; if (code == "P_ProductCommentIndex") { sel = "selected"; } builderTree.Append("<option code=\"P_ProductCommentIndex\" value=\"\" " + sel + ">" + Tag("商品晒单") + "</option>"); sel = ""; if (code == "P_Register") { sel = "selected"; } builderTree.Append("<option code=\"P_Register\" value=\"\" " + sel + ">" + Tag("会员注册") + "</option>"); sel = ""; if (code == "P_Login") { sel = "selected"; } builderTree.Append("<option code=\"P_Login\" value=\"\" " + sel + ">" + Tag("会员登录") + "</option>"); sel = ""; if (code == "P_UserCenter") { sel = "selected"; } builderTree.Append("<option code=\"P_UserCenter\" value=\"\" " + sel + ">" + Tag("会员中心") + "</option>"); sel = ""; if (code == "P_BrandList") { sel = "selected"; } builderTree.Append("<option code=\"P_BrandList\" value=\"\" " + sel + ">" + Tag("品牌列表") + "</option>"); sel = ""; if (code == "P_SupplierRegister") { sel = "selected"; } builderTree.Append("<option code=\"P_SupplierRegister\" value=\"\" " + sel + ">" + Tag("供应商注册") + "</option>"); sel = ""; if (url.Contains("/")) { sel = "selected"; } builderTree.Append("<option value=\"0\" " + sel + ">" + Tag("自定义") + "</option>"); return(builderTree.ToString()); }