Example #1
0
 protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
 {
     pageindex = RequestTool.RequestInt("page", 1);
     LoadTheme(themecode, siteid, languagecode, pcode);
     CurrentPage  = B_Lebi_Theme_Page.GetModel("Code='P_News'");
     node         = Node("News");
     path         = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_News", "") + "\"><span>" + Tag(node.Name) + "</span></a>";
     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("?page={0}", pageindex, PageSize, recordCount, CurrentLanguage);
 }
Example #2
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            if (CurrentUser.id == 0)
            {
                Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
            }
            LoadTheme(themecode, siteid, languagecode, pcode);
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserMessage'");
            type        = Rint_Para("0");
            path        = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em>";
            if (type == 0)
            {
                path += "<a href=\"" + URL("P_UserMessage", "0") + "\"><span>" + Tag("收件箱") + "</span></a>";
            }
            else
            {
                path += "<a href=\"" + URL("P_UserMessage", "1") + "\"><span>" + Tag("发件箱") + "</span></a>";
            }
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserMessage'");
            key         = Rstring("key");
            type_id     = Rstring("type_id");
            dateFrom    = Rstring("dateFrom");
            dateTo      = Rstring("dateTo");
            DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom");
            DateTime lbsql_dateTo   = RequestTool.RequestDate("dateTo");

            pageindex = RequestTool.RequestInt("page", 1);
            if (type == 0)
            {
                where = "User_id_To=" + CurrentUser.id + "";
            }
            if (type == 1)
            {
                where = "User_id_From=" + CurrentUser.id + "";
            }
            if (key != "")
            {
                where += " and (Title like lbsql{'%" + key + "%'})";
            }
            if (type_id != "")
            {
                where += " and Message_Type_id = " + type_id;
            }
            if (dateFrom != "" && dateTo != "")
            {
                where += " and (datediff(d,Time_Add,'" + lbsql_dateFrom + "')<=0 and datediff(d,Time_Add,'" + lbsql_dateTo + "')>=0)";
            }
            messages = B_Lebi_Message.GetList(where, "id desc", PageSize, pageindex);
            int recordCount = B_Lebi_Message.Counts(where);

            PageString    = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&type=" + type + "&type_id=" + type_id + "&key=" + key + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "", pageindex, PageSize, recordCount, CurrentLanguage);
            message_types = B_Lebi_Message_Type.GetList("Type_id_MessageTypeClass = 350", "id desc");
        }
Example #3
0
        public override string ThemePageMeta(string code, string tag)
        {
            string          str        = "";
            Lebi_Theme_Page theme_page = B_Lebi_Theme_Page.GetModel("Code='" + code + "'");

            if (theme_page == null)
            {
                return("");
            }
            switch (tag.ToLower())
            {
            case "description":
                if (Lang(theme_page.SEO_Description) == "")
                {
                    str = Lang(SYS.Description);
                }
                else
                {
                    str = Lang(theme_page.SEO_Description);
                }
                break;

            case "keywords":
                if (Lang(theme_page.SEO_Keywords) == "")
                {
                    str = Lang(SYS.Keywords);
                }
                else
                {
                    str = Lang(theme_page.SEO_Keywords);
                }
                break;

            default:
                if (Lang(theme_page.SEO_Title) == "")
                {
                    if (keyword != "")
                    {
                        str = keyword + " - " + Tag("品牌列表");
                    }
                    else
                    {
                        str = Tag("品牌列表");
                    }
                }
                else
                {
                    str = Lang(theme_page.SEO_Title);
                }
                break;
            }
            return(ThemePageMeta(code, tag, str));
        }
Example #4
0
        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_ShopSearch'");
            keyword     = Rstring_Para("0");

            sort  = Rstring_Para("1");
            where = "Supplier_Group_id in (select w.id from [Lebi_Supplier_Group] as w where w.type='supplier' or w.type='')";
            path  = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">&raquo;</em><a class=\"text\"><span>" + Tag("µêÆÌËÑË÷") + "</span></a><em>&raquo;</em><a class=\"text\"><span>¡°" + keyword + "¡±</span></a>";

            if (keyword != "")
            {
                string wherekeyword = "";
                if (keyword.IndexOf(" ") > -1)
                {
                    string[] keywordsArr;
                    keywordsArr = keyword.Split(new char[1] {
                        ' '
                    });
                    foreach (string keywords in keywordsArr)
                    {
                        if (keywords != "")
                        {
                            if (wherekeyword == "")
                            {
                                wherekeyword = "(Name like lbsql{'%" + keywords + "%'} or SubName like lbsql{'%" + keywords + "%'})";
                            }
                            else
                            {
                                wherekeyword += " and (Name like lbsql{'%" + keywords + "%'} or SubName like lbsql{'%" + keywords + "%'})";
                            }
                        }
                    }
                }
                else
                {
                    wherekeyword = "(Name like lbsql{'%" + keyword + "%'} or SubName like lbsql{'%" + keyword + "%'})";
                }
                where = wherekeyword;
            }


            //SQLDataAccess.SQLPara sp = new SQLDataAccess.SQLPara(where, "id desc", "*");
            shops       = B_Lebi_Supplier.GetList(where, "id desc", PageSize, pageindex);
            recordCount = B_Lebi_Supplier.Counts(where);
            string url = URL("P_ShopSearch", keyword + "," + sort + ",{0}");

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage);
        }
Example #5
0
 protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
 {
     if (CurrentUser.id == 0)
     {
         Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
     }
     LoadTheme(themecode, siteid, languagecode, pcode);
     if (SYS.IsClosetuihuo == "1")
     {
         PageError();
     }
     CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserReturnApply'");
     path        = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserReturn", "" + id + "") + "\"><span>" + Tag("退货订单") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserReturnApply", "") + "\"><span>" + Tag("退货申请") + "</span></a>";
     CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserReturnApply'");
     id          = Rint_Para("0");
     order       = B_Lebi_Order.GetModel("User_id = " + CurrentUser.id + " and id = " + id + "");
     if (order == null)
     {
         PageError();
     }
     if (order.User_id != CurrentUser.id)
     {
         PageError();
     }
     where          = "Order_id=" + order.id + "";
     order_products = B_Lebi_Order_Product.GetList(where, "id desc");
     if (order.Supplier_id > 0)
     {
         Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(order.Supplier_id);
         if (supplier != null)
         {
             shouhuoren     = supplier.RealName;
             shouhuodizhi   = supplier.Address;
             shouhuodianhua = supplier.Phone;
             shouhuoyoubian = supplier.Postalcode;
         }
     }
     else
     {
         Lebi_Express_Shipper shipper = B_Lebi_Express_Shipper.GetList("", "Sort desc", 1, 1).FirstOrDefault();
         if (shipper != null)
         {
             shouhuoren     = shipper.UserName;
             shouhuodizhi   = shipper.Address;
             shouhuodianhua = shipper.Tel;
             shouhuoyoubian = shipper.ZipCode;
         }
     }
 }
Example #6
0
        virtual public string ThemePageMeta(string code, string tag, string defaultstr)
        {
            string res = "";

            if (defaultstr != "")
            {
                res = defaultstr;
                if (tag == "title")
                {
                    res += " - " + Lang(SYS.Name);
                }
            }
            else
            {
                Lebi_Theme_Page model = B_Lebi_Theme_Page.GetModel("Code='" + code + "'");
                if (model == null)
                {
                    res = "";
                }
                else
                {
                    switch (tag.ToLower())
                    {
                    case "description":
                        if (Lang(model.SEO_Description) != "")
                        {
                            res = Lang(model.SEO_Description);
                        }
                        break;

                    case "keywords":
                        if (Lang(model.SEO_Keywords) != "")
                        {
                            res = Lang(model.SEO_Keywords);
                        }
                        break;

                    default:
                        if (Lang(model.SEO_Title) != "")
                        {
                            res = Lang(model.SEO_Title) + " - ";
                        }
                        res += Lang(SYS.Name);
                        break;
                    }
                }
            }
            return(res + LBTITLE);
        }
Example #7
0
 protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
 {
     if (CurrentUser.id == 0)
     {
         Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
     }
     LoadTheme(themecode, siteid, languagecode, pcode);
     CurrentPage    = B_Lebi_Theme_Page.GetModel("Code='P_UserQuestion'");
     type           = Rint_Para("0");
     path           = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em><a class=\"text\"><span>" + Tag("安全问题") + "</span></a>";
     user_questions = B_Lebi_User_Question.GetList("", "Sort desc");
     where          = "User_id=" + CurrentUser.id + "";
     user_answers   = B_Lebi_User_Answer.GetList(where, "id asc", 20, 1);
     recordCount    = B_Lebi_User_Answer.Counts(where);
 }
Example #8
0
 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_BrandList'");
     keyword     = Rstring_Para("0");
     pageindex   = RequestTool.RequestInt("page", 1);
     path        = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em>";
     if (keyword == "")
     {
         path += "<a class=\"text\">" + Tag("品牌列表") + "</span></a>";
     }
     else
     {
         path += "<a href=\"" + URL("P_BrandList", "") + "\"><span>" + Tag("品牌列表") + "</span></a><em>&raquo;</em><a class=\"text\">" + keyword + "</span></a>";
     }
 }
Example #9
0
        override public string ThemePageMeta(string code, string tag)
        {
            string          str        = "";
            Lebi_Theme_Page theme_page = B_Lebi_Theme_Page.GetModel("Code='" + code + "'");

            if (theme_page == null)
            {
                return("");
            }
            switch (tag.ToLower())
            {
            case "description":
                if (theme_page.SEO_Description != "")
                {
                    str = theme_page.SEO_Description;
                }
                else
                {
                    str = Lang(SYS.Description);
                }
                break;

            case "keywords":
                if (theme_page.SEO_Keywords != "")
                {
                    str = theme_page.SEO_Keywords;
                }
                else
                {
                    str = Lang(SYS.Keywords);
                }
                break;

            default:
                if (theme_page.SEO_Title != "")
                {
                    str = theme_page.SEO_Title;
                }
                else
                {
                    str = Tag(node.Name);
                }
                break;
            }
            return(ThemePageMeta(code, tag, str));
        }
Example #10
0
        virtual public string ThemePageMeta(string code, string tag, string defaultstr)
        {
            if (defaultstr != "")
            {
                return(defaultstr);
            }
            Lebi_Theme_Page model = B_Lebi_Theme_Page.GetModel("Code='" + code + "'");

            if (model == null)
            {
                return("");
            }
            switch (tag.ToLower())
            {
            case "description":
                if (Lang(model.SEO_Description) == "")
                {
                    return(SYS.Description);
                }
                else
                {
                    return(Lang(model.SEO_Description));
                }

            case "keywords":
                if (Lang(model.SEO_Keywords) == "")
                {
                    return(SYS.Keywords);
                }
                else
                {
                    return(Lang(model.SEO_Keywords));
                }

            default:
                if (Lang(model.SEO_Title) == "")
                {
                    return(SYS.Title);
                }
                else
                {
                    return(Lang(model.SEO_Title));
                }
            }
        }
Example #11
0
        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_NewsDetails'");
            int id = Rint_Para("0");

            node = Node("News");
            page = B_Lebi_Page.GetModel(id);
            if (page == null)
            {
                PageError();
            }
            else
            {
                page.Count_Views += 1;
                B_Lebi_Page.Update(page);
            }
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_News", "") + "\"><span>" + Tag(node.Name) + "</span></a><em>&raquo;</em><a href=\"" + URL("P_NewsDetails", page.id) + "\"><span>" + page.Name + "</span></a>";
        }
Example #12
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            if (CurrentUser.id == 0)
            {
                Response.Write("<script type=\"text/javascript\">alert('" + Tag("已购买商品在已收货之后才可以发表评价") + "');window.location.href='" + URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "") + "';</script>");
                Response.End();
                //Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain())+ ""));
            }
            path        = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserComment", "1") + "\"><span>" + Tag("商品评价") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserCommentWrite", "") + "\"><span>" + Tag("发表评价") + "</span></a>";
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserCommentWrite'");

            id            = Rint("id");
            order_product = B_Lebi_Order_Product.GetModel("id = " + id + " and IsCommented = 0 and User_id=" + CurrentUser.id + "");
            if (order_product == null)
            {
                Response.Write("<script type=\"text/javascript\">alert('" + Tag("已购买商品在已收货之后才可以发表评价") + "');javascript:window.history.back();</script>");
                Response.End();
            }
        }
Example #13
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            if (CurrentUser.id == 0)
            {
                Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
            }
            LoadTheme(themecode, siteid, languagecode, pcode);
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserReturnShip'");
            id          = Rint("id");
            tid         = Rint("id");
            order       = B_Lebi_Order.GetModel("User_id = " + CurrentUser.id + " and id = " + id + "");
            if (order == null)
            {
                PageError();
            }
            if (order.User_id != CurrentUser.id)
            {
                PageError();
            }
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserReturn", "" + id + "") + "\"><span>" + Tag("退货订单") + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserReturnDetails", "" + id + "") + "\"><span>" + Tag("订单") + ":" + order.Code + "</span></a><em>&raquo;</em><a href=\"" + URL("P_UserReturnShip", "") + "\"><span>" + Tag("发货") + "</span></a>";

            where          = "Order_id=" + order.id + "";
            order_products = B_Lebi_Order_Product.GetList(where, "id desc");
        }
Example #14
0
        /// <summary>
        /// 生成地址重写规则
        /// </summary>
        public static void CreateURLRewrite()
        {
            StringBuilder sb  = new StringBuilder();
            StringBuilder sb1 = new StringBuilder();

            sb.AppendLine("[ISAPI_Rewrite]");
            sb1.AppendLine("RewriteEngine On");
            sb1.AppendLine("RewriteCompatibility2 On");
            sb1.AppendLine("RepeatLimit 200");
            sb1.AppendLine("RewriteBase");

            List <Lebi_Language>   langs  = B_Lebi_Language.GetList("", "Sort desc,id asc");
            List <Lebi_Theme_Page> models = B_Lebi_Theme_Page.GetList("Type_id_PublishType=123", "");
            string str1     = "";
            string str2     = "";
            string language = "";

            foreach (Lebi_Theme_Page model in models)
            {
                if (model.PageParameter == "")
                {
                    str1 = model.PageName;
                    str2 = model.StaticPath + "/" + model.StaticPageName;
                    str2 = ThemeUrl.CheckURL(str2);
                    str1 = str1.Trim('/');
                    str2 = str2.Trim('/');
                    str1 = str1.Replace(".", @"\.");
                    str2 = str2.Replace(".", @"\.");
                    foreach (Lebi_Language lang in langs)
                    {
                        Lebi_Site site = B_Lebi_Site.GetModel(lang.Site_id);
                        if (site == null)
                        {
                            site = new Lebi_Site();
                        }
                        language = site.Path + lang.Path.TrimEnd('/');
                        language = language.Replace("//", "/");
                        if (language == "")
                        {
                            continue;
                        }
                        sb.AppendLine(@"RewriteRule /(.*)" + language + "/" + str2 + "(.*) /$1" + language + "/" + str1 + " [N,I]");
                        sb1.AppendLine(@"RewriteRule " + language + "/" + str2 + "(.*)$ " + language + "/" + str1 + " [NC,N]");
                    }
                    sb.AppendLine(@"RewriteRule /(.*)" + str2 + "(.*) /$1" + str1 + " [N,I]");
                    sb1.AppendLine(@"RewriteRule /" + str2 + "(.*)$ /" + str1 + " [NC,N]");
                    //RewriteRule /CN/(.*)$ /CN/Basket\.aspx\?Basket\.html$1 [NC,N]
                    //RewriteRule /(.*)$ /Basket\.aspx\?Basket\.html$1 [NC,N]
                }
                else
                {
                    str1 = model.PageName + @"\?" + model.PageParameter;
                    str2 = model.StaticPath + "/" + model.StaticPageName;
                    str2 = ThemeUrl.CheckURL(str2);
                    str1 = str1.Trim('/');
                    str2 = str2.Trim('/');
                    str1 = str1.Replace(".", @"\.");
                    str2 = str2.Replace(".", @"\.");
                    str1 = RegexTool.ReplaceRegValue(str1, @"{\d+}", ",");
                    str2 = RegexTool.ReplaceRegValue(str2, @"{\d+}", "(.*)");
                    string[] arr     = str1.Split(',');
                    int      j       = 1;
                    string   str_ini = "";
                    string   str_hta = "";
                    foreach (string ar in arr)
                    {
                        if (ar != "")
                        {
                            str_hta += ar + "$" + j;
                        }
                        j++;
                        if (ar != "")
                        {
                            str_ini += ar + "$" + j;
                        }
                    }
                    foreach (Lebi_Language lang in langs)
                    {
                        Lebi_Site site = B_Lebi_Site.GetModel(lang.Site_id);
                        if (site == null)
                        {
                            site = new Lebi_Site();
                        }
                        language = site.Path + lang.Path.TrimEnd('/');
                        language = language.Replace("//", "/");
                        if (language == "")
                        {
                            continue;
                        }
                        sb.AppendLine(@"RewriteRule /(.*)" + language + "/" + str2 + "(.*) /$1" + language + "/" + str_ini + " [N,I]");
                        sb1.AppendLine(@"RewriteRule " + language + "/" + str2 + "(.*)$ " + language + "/" + str_hta + " [NC,N]");
                    }
                    sb.AppendLine(@"RewriteRule /(.*)" + str2 + "(.*) /$1" + str_ini + " [N,I]");
                    sb1.AppendLine(@"RewriteRule /" + str2 + "(.*)$ /" + str_hta + " [NC,N]");
                }
            }
            //生成商品分类重写规则
            List <Lebi_Pro_Type> tps   = B_Lebi_Pro_Type.GetList("", "");
            Lebi_Theme_Page      tpage = B_Lebi_Theme_Page.GetModel("Code='P_ProductCategory'");

            str1 = tpage.PageName + @"\?" + tpage.PageParameter;
            str1 = str1.Trim('/');
            str1 = str1.Replace(".", @"\.");
            str1 = RegexTool.ReplaceRegValue(str1, @"{\d+}", ",");
            string[] arr1     = str1.Split(',');
            string   str_ini1 = "";
            string   str_hta1 = "";

            //foreach (string ar in arr1)
            //{
            //    if (ar != "")
            //        str_hta1 += ar + "$" + j1;
            //    j1++;
            //    if (ar != "")
            //        str_ini1 += ar + "$" + j1;

            //}

            foreach (Lebi_Pro_Type tp in tps)
            {
                str_hta1 = arr1[0] + tp.id;
                str_ini1 = arr1[0] + tp.id;
                foreach (Lebi_Language lang in langs)
                {
                    if (Language.Content(tp.IsUrlrewrite, lang.Code) != "1")
                    {
                        continue;
                    }
                    str2 = Language.Content(tp.Url, lang.Code);
                    if (str2 == "")
                    {
                        continue;
                    }



                    str2 = ThemeUrl.CheckURL(str2);
                    str2 = str2.Trim('/');
                    str2 = str2.Replace(".", @"\.");
                    str2 = RegexTool.ReplaceRegValue(str2, @"{\d+}", "(.*)");


                    Lebi_Site site = B_Lebi_Site.GetModel(lang.Site_id);
                    if (site == null)
                    {
                        site = new Lebi_Site();
                    }
                    language = site.Path + lang.Path.TrimEnd('/');
                    language = language.Replace("//", "/");
                    language = language.TrimEnd('/');
                    sb.AppendLine(@"RewriteRule /(.*)" + language + "/" + str2 + "(.*) /$1" + language + "/" + str_ini1 + " [N,I]");
                    sb1.AppendLine(@"RewriteRule /(.*)" + language + "/" + str2 + "(.*)$ /$1" + language + "/" + str_hta1 + " [NC,N]");
                }
            }
            HtmlEngine save = new HtmlEngine();

            save.CreateFile("httpd.ini", sb.ToString(), "ascii");
            save.CreateFile(".htaccess", sb1.ToString(), "ascii");
            CreateURLRewrite_shop();
        }
Example #15
0
        /// <summary>
        /// 设置页面设置缓存
        /// </summary>
        public static void SetThemePage()
        {
            List <Lebi_Theme_Page> models = B_Lebi_Theme_Page.GetList("", "");

            CacheTool.Permanent("ThemePage", models);
        }
Example #16
0
        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_LimitBuy'");
            list        = Rstring_Para("0");
            sort        = Rstring_Para("1");
            pageindex   = RequestTool.RequestInt("page", 1);
            path        = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a class=\"text\"><span>" + Tag("限时抢购") + "</span></a>";
            where       = "Type_id_ProductStatus = 101 and Type_id_ProductType = 321 and Product_id=0";
            if (sort == "1")
            {
                order = " Count_Sales desc"; ordertmp = "a";
            }
            else if (sort == "1a")
            {
                order = " Count_Sales asc"; ordertmp = "";
            }
            else if (sort == "2")
            {
                order = " Price desc"; ordertmp = "a";
            }
            else if (sort == "2a")
            {
                order = " Price asc"; ordertmp = "";
            }
            else if (sort == "3")
            {
                order = " Count_Comment desc"; ordertmp = "a";
            }
            else if (sort == "3a")
            {
                order = " Count_Comment asc"; ordertmp = "";
            }
            else if (sort == "4")
            {
                order = " Time_Add desc"; ordertmp = "a";
            }
            else if (sort == "4a")
            {
                order = " Time_Add asc"; ordertmp = "";
            }
            else if (sort == "5")
            {
                order = " Count_Views_Show desc"; ordertmp = "a";
            }
            else if (sort == "5a")
            {
                order = " Count_Views_Show asc"; ordertmp = "";
            }
            else if (sort == "6")
            {
                order = " Count_Stock desc"; ordertmp = "a";
            }
            else if (sort == "6a")
            {
                order = " Count_Stock asc"; ordertmp = "";
            }
            else
            {
                order = " Count_Sales desc"; ordertmp = "a";
            }
            products    = B_Lebi_Product.GetList(where, order, PageSize, pageindex);
            recordCount = B_Lebi_Product.Counts(where);

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple("?page={0}&sort=" + sort + "&list=" + list + "", pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&sort=" + sort + "&list=" + list + "", pageindex, PageSize, recordCount, CurrentLanguage);
        }
Example #17
0
        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_Product'");
            int id = Rint_Para("0");

            product = GetProduct(id);
            if (product.id == 0)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            int num = 0;

            if (SYS.ClickFlag == "0")
            {
                int.TryParse(SYS.ClickNum1, out num);
                product.Count_Views_Show = product.Count_Views_Show + num;
            }
            else
            {
                int.TryParse(SYS.ClickNum2, out num);
                Random r = new Random();
                int    c = r.Next(1, num);
                product.Count_Views_Show = product.Count_Views_Show + c;
            }
            product.Count_Views = product.Count_Views + 1;
            B_Lebi_Product.Update(product);
            Protype = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id);
            images  = EX_Product.ProductImages(product, CurrentTheme);
            //===============================================================
            //处理规格选项
            //ProductProperty = Get_guige(product);
            //处理规格选项结束
            //==================================================================


            //添加访问记录
            int Product_id = product.Product_id == 0 ? product.id : product.Product_id;

            EX_User.UserProduct_Edit(CurrentUser, Product_id, 0, 143, "", 0, "");
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em>";
            if (product.Type_id_ProductType == 321)
            {
                path += "<a href=\"" + URL("P_LimitBuy", "") + "\"><span>" + Tag("限时抢购") + "</span></a><em>&raquo;</em>";
            }
            else if (product.Type_id_ProductType == 322)
            {
                path += "<a href=\"" + URL("P_GroupPurchase", "") + "\"><span>" + Tag("团购") + "</span></a><em>&raquo;</em>";
            }
            else if (product.Type_id_ProductType == 323)
            {
                path += "<a href=\"" + URL("P_Exchange", "") + "\"><span>" + Tag("积分换购") + "</span></a><em>&raquo;</em>";
            }
            else
            {
                if (Protype != null)
                {
                    string[,] parr = Categorypath(Protype.id);
                    for (int i = 0; i <= parr.GetUpperBound(0); i++)
                    {
                        path += "<a href=\"" + URL("P_ProductCategory", "" + parr[i, 0] + "") + "\"><span>" + parr[i, 1] + "</span></a><em>&raquo;</em>";
                    }
                }
            }
            path += "<a href=\"" + URL("P_Product", id) + "\"><span>" + Lang(product.Name) + "</span></a>";


            GetProWords();
            ProductStar = Convert.ToInt32(product.Star_Comment);
            if (ProductStar > 5)
            {
                ProductStar = 5;
            }
            if (ProductStar < 0)
            {
                ProductStar = 0;
            }
        }
Example #18
0
        /// <summary>
        /// 载入主题
        /// </summary>
        /// <param name="themecode"></param>
        /// <param name="siteid"></param>
        /// <param name="languagecode"></param>
        /// <param name="pcode"></param>
        /// <param name="checklogin">是否检查用户登录</param>
        public void LoadTheme(string themecode, int siteid, string languagecode, string pcode, bool checklogin)
        {
            CurrentSite_ = B_Lebi_Site.GetModel(siteid);
            if (ShopCache.GetMainSite().id == CurrentSite_.id || CurrentSite_.Domain == "")
            {
                IsMainSite = true;
            }
            CurrentLanguage_ = B_Lebi_Language.GetModel("Code='" + languagecode + "' and Site_id=" + siteid + "");
            if (CurrentLanguage_ == null)
            {
                CurrentLanguage_ = new Lebi_Language();
            }

            if (IsMainSite)
            {
                CurrentLanguage_.Path = (CurrentSite_.Path + CurrentLanguage_.Path).Replace("//", "/").TrimEnd('/');
            }
            if (checklogin)
            {
                if (CurrentUser.id == 0 || CurrentUser.IsAnonymous == 1)
                {
                    HttpContext.Current.Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
                }
            }
            CurrentTheme_ = B_Lebi_Theme.GetModel("Code='" + themecode + "'");
            CurrentPage   = B_Lebi_Theme_Page.GetModel("Code='" + pcode + "'");
            if (CurrentTheme_ == null)
            {
                CurrentTheme_ = new Lebi_Theme();
            }
            Lebi_Theme_Skin skin = B_Lebi_Theme_Skin.GetModel("Theme_id=" + CurrentTheme_.id + " and Code='" + pcode + "'");

            if (skin != null)
            {
                if (skin.PageSize > 0)
                {
                    PageSize = skin.PageSize;
                }
            }
            if (CurrentSite_ != null)
            {
                SYS.Copyright   = CurrentSite_.Copyright;
                SYS.Domain      = CurrentSite_.Domain;
                SYS.Email       = CurrentSite_.Email;
                SYS.Fax         = CurrentSite_.Fax;
                SYS.Keywords    = CurrentSite_.Keywords;
                SYS.Logoimg     = CurrentSite_.Logoimg;
                SYS.Description = CurrentSite_.Description;
                SYS.Phone       = CurrentSite_.Phone;
                SYS.QQ          = CurrentSite_.QQ;
                SYS.ServiceP    = CurrentSite_.ServiceP;
                SYS.Name        = CurrentSite_.Name;
                SYS.Title       = CurrentSite_.Title;
                SYS.FootHtml    = CurrentSite_.FootHtml;
                SYS.TopAreaid   = CurrentLanguage_.TopAreaid.ToString();
            }
            LBTITLE  = "";
            LBTITLE += " - Powered by LebiShop";
            //底部版权信息
            //if (CurrentPage != null)
            //{
            //    StringBuilder sb = new StringBuilder();
            //    sb.Append("Powered by <a style=\"font-size:12px;color:#00497f\" href=\"http://www.lebi.cn\" target=\"_blank\" title=\"LebiShop多语言网上商店系统\">LebiShop</a> ");
            //    sb.Append("V" + SYS.Version + "." + SYS.Version_Son);
            //    try
            //    {
            //        Label label = (Label)this.Page.FindControl("LeBiLicense");
            //        label.Text = sb.ToString();
            //    }
            //    catch (System.NullReferenceException)
            //    {
            //        Response.Write("<div style=\"height:100px;padding-top:10px;text-align:left;font-size:12;\">内部错误,请到【配置】=》【站点语言】栏目中重新生成网站<br>");
            //        Response.Write(sb.ToString() + "</div>");
            //        Response.End();
            //    }
            //}
            Session["CurrentTheme"]    = CurrentTheme_;//session主要是为那些没有LoadTheme方法的页面服务的,如ajax
            Session["CurrentLanguage"] = CurrentLanguage_;
            Session["CurrentSite"]     = CurrentSite_;
            //写入cookie
            NameValueCollection nvs = new NameValueCollection();

            nvs.Add("theme", CurrentTheme_.Code);
            nvs.Add("language", CurrentLanguage_.Code);
            nvs.Add("site", CurrentSite_.id.ToString());
            CookieTool.WriteCookie("ThemeStatus", nvs, 10);
            //多站点商品显示
            if (Shop.Bussiness.Site.Instance.SiteCount > 1)
            {
                //if (Shop.LebiAPI.Service.Instanse.Check("domain3admin"))
                //{
                if (DataBase.DBType == "sqlserver")
                {
                    ProductWhere         = "(Charindex('," + CurrentSite_.id + ",',','+Site_ids+',')>0 or Site_ids='') and Product_id = 0 and Type_id_ProductStatus = 101";
                    ProductCategoryWhere = "(Charindex('," + CurrentSite_.id + ",',','+Site_ids+',')>0 or Site_ids='')";
                }
                if (DataBase.DBType == "access")
                {
                    ProductWhere         = "(Instr(','+Site_ids+',','," + CurrentSite_.id + ",')>0 or Site_ids='') and Product_id = 0 and Type_id_ProductStatus = 101";
                    ProductCategoryWhere = "(Instr(','+Site_ids+',','," + CurrentSite_.id + ",')>0 or Site_ids='')";
                }
                //}
                //else
                //{
                //    ProductWhere = "Product_id = 0 and Type_id_ProductStatus = 101";
                //}
            }
            else
            {
                ProductWhere         = "Product_id = 0 and Type_id_ProductStatus = 101";
                ProductCategoryWhere = "1=1";
            }
            //ProductWhere += " and (UserLevel_ids_show='' or UserLevel_ids_show is null or ','+UserLevel_ids_show+',' like '%," + CurrentUserLevel.id + ",%'  )";
            ProductWhere += " and (IsDel!=1 or IsDel is null)";
        }
Example #19
0
        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_Brand'");
            id          = Rint_Para("0");
            cid         = Rstring_Para("1");
            list        = Rstring_Para("2");
            sort        = Rstring_Para("3");
            pageindex   = RequestTool.RequestInt("page", 1);
            brand       = B_Lebi_Brand.GetModel(id);
            if (brand == null)
            {
                Response.Redirect(URL("P_BrandList", ""));
                Response.End();
            }
            path  = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_BrandList", "") + "\"><span>" + Tag("品牌列表") + "</span></a><em>&raquo;</em><a class=\"text\"><span>" + Lang(brand.Name) + "</span></a>";
            where = "Type_id_ProductStatus = 101 and Product_id=0 and Type_id_ProductType <> 323";
            if (id > 0)
            {
                where += " and Brand_id = " + id + "";
            }
            if (cid != "")
            {
                where += " and " + Categorywhere(cid);
            }
            if (sort == "1")
            {
                order = " Count_Sales_Show desc"; ordertmp = "a";
            }
            else if (sort == "1a")
            {
                order = " Count_Sales_Show asc"; ordertmp = "";
            }
            else if (sort == "2")
            {
                order = " Price desc"; ordertmp = "a";
            }
            else if (sort == "2a")
            {
                order = " Price asc"; ordertmp = "";
            }
            else if (sort == "3")
            {
                order = " Count_Comment desc"; ordertmp = "a";
            }
            else if (sort == "3a")
            {
                order = " Count_Comment asc"; ordertmp = "";
            }
            else if (sort == "4")
            {
                order = " Time_Add desc"; ordertmp = "a";
            }
            else if (sort == "4a")
            {
                order = " Time_Add asc"; ordertmp = "";
            }
            else if (sort == "5")
            {
                order = " Count_Views_Show desc"; ordertmp = "a";
            }
            else if (sort == "5a")
            {
                order = " Count_Views_Show asc"; ordertmp = "";
            }
            else if (sort == "6")
            {
                order = " Count_Stock desc"; ordertmp = "a";
            }
            else if (sort == "6a")
            {
                order = " Count_Stock asc"; ordertmp = "";
            }
            else
            {
                order = " Sort desc,id desc"; ordertmp = "";
            }
            products    = B_Lebi_Product.GetList(where, order, PageSize, pageindex);
            recordCount = B_Lebi_Product.Counts(where);

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple("?page={0}&id=" + id + "&cid=" + cid + "&sort=" + sort + "&list=" + list + "", pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&id=" + id + "&cid=" + cid + "&sort=" + sort + "&list=" + list + "", pageindex, PageSize, recordCount, CurrentLanguage);
        }
Example #20
0
        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_Search'");
            keyword     = Rstring_Para("0");
            list        = Rstring_Para("1");
            sort        = Rstring_Para("2");
            pageindex   = Rint_Para("3");
            id          = Rint_Para("4");
            pid         = Rint_Para("5");
            path        = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a class=\"text\"><span>" + Tag("商品搜索") + "</span></a><em>&raquo;</em><a class=\"text\"><span>“" + keyword + "”</span></a>";
            where       = ProductWhere + " and Type_id_ProductType <> 323";
            if (keyword != "")
            {
                //增加空格划词搜索 by kingdge 2013-09-18
                string wherekeyword = "";
                if (keyword.IndexOf(" ") > -1)
                {
                    string[] keywordsArr;
                    keywordsArr = keyword.Split(new char[1] {
                        ' '
                    });
                    foreach (string keywords in keywordsArr)
                    {
                        if (keywords != "")
                        {
                            if (wherekeyword == "")
                            {
                                wherekeyword = "Name like lbsql{'%" + keywords + "%'}";
                            }
                            else
                            {
                                wherekeyword += " and Name like lbsql{'%" + keywords + "%'}";
                            }
                        }
                    }
                }
                else
                {
                    wherekeyword = "Name like lbsql{'%" + keyword + "%'}";
                }
                where += " and ((" + wherekeyword + ") or Number like lbsql{'%" + keyword + "%'} or Code like lbsql{'%" + keyword + "%'})";
            }
            if (id > 0)
            {
                where += " and " + CategoryWhere(id);
            }
            if (pid > 0)
            {
                where += " and Brand_id=" + pid + "";
            }
            if (sort == "1")
            {
                order = " Count_Sales_Show desc"; ordertmp = "a";
            }
            else if (sort == "1a")
            {
                order = " Count_Sales_Show asc"; ordertmp = "";
            }
            else if (sort == "2")
            {
                order = " Price desc"; ordertmp = "a";
            }
            else if (sort == "2a")
            {
                order = " Price asc"; ordertmp = "";
            }
            else if (sort == "3")
            {
                order = " Count_Comment desc"; ordertmp = "a";
            }
            else if (sort == "3a")
            {
                order = " Count_Comment asc"; ordertmp = "";
            }
            else if (sort == "4")
            {
                order = " Time_Add desc"; ordertmp = "a";
            }
            else if (sort == "4a")
            {
                order = " Time_Add asc"; ordertmp = "";
            }
            else if (sort == "5")
            {
                order = " Count_Views_Show desc"; ordertmp = "a";
            }
            else if (sort == "5a")
            {
                order = " Count_Views_Show asc"; ordertmp = "";
            }
            else if (sort == "6")
            {
                order = " Count_Stock desc"; ordertmp = "a";
            }
            else if (sort == "6a")
            {
                order = " Count_Stock asc"; ordertmp = "";
            }
            else
            {
                order = " Sort desc,id desc"; ordertmp = "";
            }
            SQLDataAccess.SQLPara sp = new SQLDataAccess.SQLPara(where, order, "*");
            products    = B_Lebi_Product.GetList(sp, PageSize, pageindex);
            recordCount = B_Lebi_Product.Counts(sp);
            string url = URL("P_Search", keyword + "," + list + "," + sort + ",{0}");

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage);
        }
Example #21
0
 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\">&raquo;</em><a href=\"" + URL("P_Help", "") + "\"><span>" + Tag(parentnode.Name) + "</span></a><em>&raquo;</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\">&raquo;</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>&raquo;</em><a href=\"" + URL("P_Help", node.id) + "\"><span>" + node.Name + "</span></a><em>&raquo;</em><a class=\"text\"><span>" + page.Name + "</span></a>";
         }
         //Help_Content.pages = pages;
     }
 }