Пример #1
0
        /// <summary>
        /// 生成帮助中心
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public static bool Greate_Help(Lebi_Theme_Page page)
        {
            string               url;
            Site                 site    = new Site();
            Lebi_Node            pnode   = NodePage.GetNodeByCode("Help");
            List <Lebi_Language> langs   = Language.AllLanguages();
            string               urlpath = "http://" + HttpContext.Current.Request.Url.Authority + site.WebPath;

            foreach (Lebi_Language lang in langs)
            {
                string           path  = lang.Path + "/" + page.StaticPath + "/" + page.StaticPageName;
                string           file  = "";
                List <Lebi_Node> nodes = B_Lebi_Node.GetList("parentid=" + pnode.id + " and Language_Code like '%" + lang.Code + "%'", "");
                foreach (Lebi_Node node in nodes)
                {
                    url  = page.PageName + "?" + page.PageParameter;
                    url  = url.Replace("{0}", node.id.ToString());
                    url  = urlpath + "/" + url;
                    file = path.Replace("{0}", node.id.ToString());
                    file = RegexTool.ReplaceRegValue(file, @"{.*?}", "");
                    url  = RegexTool.ReplaceRegValue(url, @"{.*?}", "");
                    url  = ThemeUrl.CheckURL(url);
                    HtmlEngine.Instance.CreatHtml(url, file);
                }
            }
            return(true);
        }
Пример #2
0
        /// <summary>
        /// 生成插件页面
        /// </summary>
        /// <param name="pgconf"></param>
        /// <param name="site"></param>
        /// <param name="type"></param>
        /// <param name="parentpath"></param>
        public static void CreatePluginPage(PluginConfig pgconf, string type, string parentpath)
        {
            string WebPath   = Site.Instance.WebPath;
            string path      = System.Web.HttpRuntime.AppDomainAppPath + "/plugin/" + pgconf.Assembly.ToLower() + "/systempage/" + type + "/page/" + parentpath;
            string filepath  = WebPath + "/plugin/" + pgconf.Assembly.ToLower() + "/systempage/" + type + "/page/" + parentpath;
            string mediapath = "/plugin/" + pgconf.Assembly.ToLower() + "/systempage/" + type;

            if (type == "admin")
            {
                if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                {
                    path      = System.Web.HttpRuntime.AppDomainAppPath + "/plugin/" + pgconf.Assembly.ToLower() + "/systempage/" + RequestTool.GetConfigKey("SystemAdmin").Trim() + "/page/" + parentpath;
                    filepath  = WebPath + "/plugin/" + pgconf.Assembly.ToLower() + "/systempage/" + RequestTool.GetConfigKey("SystemAdmin").Trim() + "/page/" + parentpath;
                    mediapath = "/plugin/" + pgconf.Assembly.ToLower() + "/systempage/" + RequestTool.GetConfigKey("SystemAdmin").Trim();
                }
            }
            if (!Directory.Exists(path))
            {
                return;
            }
            DirectoryInfo mydir = new DirectoryInfo(path);

            DirectoryInfo[] dirs = mydir.GetDirectories();
            foreach (DirectoryInfo dir in dirs)
            {
                CreatePluginPage(pgconf, type, parentpath + "/" + dir.Name);//递归全部文件夹
            }
            FileInfo[] files    = mydir.GetFiles();
            string     content  = "";
            string     pagename = "";

            parentpath = parentpath.ToLower().Trim('/');

            string createpath = type;

            if (type == "admin")
            {
                createpath = Site.Instance.AdminPath;
            }
            else if (type == "supplier")
            {
                createpath = Site.Instance.SupplierPath;
            }
            //parentpath = parentpath.Substring(type.Length, parentpath.Length - type.Length);
            if (!Directory.Exists(System.Web.HttpRuntime.AppDomainAppPath + "/" + createpath))
            {
                Directory.CreateDirectory(System.Web.HttpRuntime.AppDomainAppPath + "/" + createpath);
            }
            foreach (FileInfo f in files)
            {
                pagename = f.Name.Replace(".html", ".aspx");
                pagename = ThemeUrl.GetFullPath(WebPath + "/" + createpath + "/" + parentpath + "/" + pagename);
                content  = HtmlEngine.ReadTxt(filepath + "/" + f.Name);
                CreatAdminAspx(pagename, content, type, mediapath);
            }
        }
Пример #3
0
        /// <summary>
        /// 商品分类页面
        /// </summary>
        public static bool Greate_OnePage(Lebi_Theme_Page page)
        {
            Site site = new Site();
            //Lebi_Theme_Page page = B_Lebi_Theme_Page.GetModel("Code='P_AllProductCategories'");
            string urlpath = "http://" + HttpContext.Current.Request.Url.Authority + site.WebPath;
            string url     = "";
            string file    = "";

            foreach (Lebi_Language lang in Language.AllLanguages())
            {
                string path = lang.Path + "/" + page.StaticPath + "/" + page.StaticPageName;
                url  = page.PageName + "?" + page.PageParameter;
                url  = urlpath + "/" + url;
                file = RegexTool.ReplaceRegValue(file, @"{.*?}", "");
                url  = RegexTool.ReplaceRegValue(url, @"{.*?}", "");
                url  = ThemeUrl.CheckURL(url);
                HtmlEngine.Instance.CreatHtml(url, file);
            }
            return(true);
        }
Пример #4
0
 public string MenuUrl(string url, int t)
 {
     if (url.IndexOf("http") == 0)
     {
         return(url);
     }
     url = site.AdminPath + "/" + url;
     if (t == 1)
     {
         if (url.Contains("?"))
         {
             url = url + "&desk=1";
         }
         else
         {
             url = url + "?desk=1";
         }
     }
     url = ThemeUrl.CheckURL(url);
     return(url);
 }
Пример #5
0
        /// <summary>
        /// 关于我们页面/新闻/文章
        /// </summary>
        public static bool Greate_InfoPage(Lebi_Page model, Lebi_Theme_Page page)
        {
            Site site = new Site();

            string[] langcodes = model.Language.Split(',');
            string   urlpath   = "http://" + HttpContext.Current.Request.Url.Authority + site.WebPath;
            string   url       = "";
            string   file      = "";

            foreach (string langcode in langcodes)
            {
                Lebi_Language lang = B_Lebi_Language.GetModel("Code='" + langcode + "'");
                string        path = lang.Path + "/" + page.StaticPath + "/" + page.StaticPageName;
                url  = page.PageName + "?" + page.PageParameter;
                url  = url.Replace("{0}", model.id.ToString());
                url  = urlpath + "/" + url;
                file = path.Replace("{0}", model.id.ToString());
                file = RegexTool.ReplaceRegValue(file, @"{.*?}", "");
                url  = RegexTool.ReplaceRegValue(url, @"{.*?}", "");
                url  = ThemeUrl.CheckURL(url);
                HtmlEngine.Instance.CreatHtml(url, file);
            }
            return(true);
        }
Пример #6
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();
        }
Пример #7
0
 /// <summary>
 /// 返回图片的显示路径
 /// </summary>
 /// <param name="img"></param>
 /// <returns></returns>
 public string GetImage(string img)
 {
     img = WebPath + "/" + img;
     img = ThemeUrl.CheckURL(img);
     return(img);
 }
Пример #8
0
        /// <summary>
        /// 执行代码替换
        /// 在${...}$内
        /// </summary>
        /// <param name="strIn"></param>
        /// <returns></returns>
        public static string DoCodeConvert(string strIn, string type, string webpath, string mediapath)
        {
            strIn = DoLayout(strIn, type, webpath, mediapath);
            //======================================================
            string[] PartArry   = RegexTool.GetSimpleRegResultArray(strIn, @"({[Mm][Oo][Dd]:.*?})");
            string   partTag    = "";
            string   partConten = "";
            string   partPara   = "";

            webpath = webpath.TrimEnd('/');
            Lebi_Theme_Skin partskin = new Lebi_Theme_Skin();

            foreach (string partStr in PartArry)
            {
                partTag    = "";
                partConten = "";
                partPara   = "";
                if (partStr.Contains("("))
                {
                    partTag  = RegexTool.GetRegValue(partStr, @"{[Mm][Oo][Dd]:(.*?)\(.*?}");
                    partPara = RegexTool.GetRegValue(partStr, @"{[Mm][Oo][Dd]:.*?\((.*?)\)}");
                }
                else
                {
                    partTag = RegexTool.GetRegValue(partStr, @"{[Mm][Oo][Dd]:(.*?)}");
                }
                if (partTag != "")
                {
                    //模块提取优先级
                    //1插件中的BLOCK文件夹
                    //2模板中的自定义设置
                    //3系统块

                    string[] plugins = ShopCache.GetBaseConfig().PluginUsed.ToLower().Split(',');
                    foreach (string plugin in plugins)
                    {
                        partConten = HtmlEngine.ReadTxt(webpath + "/plugin/" + plugin + "/systempage/" + type + "/block/" + partTag + ".html");
                        if (partConten == "")
                        {
                            partConten = HtmlEngine.ReadTxt(webpath + "/plugin/" + plugin + "/block/" + partTag + ".html");
                        }
                        if (partConten != "")
                        {
                            break;
                        }
                    }

                    if (partConten == "")
                    {
                        partConten = HtmlEngine.ReadTxt(ThemeUrl.GetFullPath(webpath + "/system/" + type + "/block/" + partTag + ".html"));
                    }
                    if (partConten == "")
                    {
                        partConten = HtmlEngine.ReadTxt(ThemeUrl.GetFullPath(webpath + "/system/block/" + partTag + ".html"));
                    }
                    if (partConten != "")
                    {
                        partConten = "<!--MOD_start:" + partTag + "-->\r\n" + DoCodeConvert(partConten, type, webpath, "") + "<!--MOD_end:" + partTag + "-->\r\n";
                        strIn      = RegexTool.ReplaceRegValue(strIn, @"{[Mm][Oo][Dd]:" + partTag + ".*?}", partConten);
                    }
                }
            }
            //=========================================================
            string str  = "";
            Type   t    = typeof(ShopPage);
            string temp = "";

            int[,] d = IndexFlagArry(strIn);//记录开始,结尾标记的数组
            if (d.Length > 0)
            {
                int begin = 0;
                string[,] tempArry = new string[d.GetUpperBound(0) + 1, 2];//用于存放一个外层标记的临时数组
                for (int i = 0; i < d.GetUpperBound(0); i++)
                {
                    temp          += RegexTool.GetSubString(strIn, begin, d[i, 0]) + "$$$" + i + "$$$";//挑选非标记部组合,将标记部分替换为$$$0$$$,$$$1$$$形式
                    begin          = d[i, 1] + 2;
                    tempArry[i, 0] = "$$$" + i + "$$$";
                    tempArry[i, 1] = RegexTool.GetSubString(strIn, d[i, 0] + 2, d[i, 1]);//截取不包含开始,结尾标记的块
                }
                temp += RegexTool.GetSubString(strIn, begin, strIn.Length);
                str   = temp;//str已经替除了全部的标记块

                for (int i = 0; i < tempArry.GetUpperBound(0); i++)
                {
                    temp = DoPart(tempArry[i, 1], type, webpath);
                    str  = str.Replace("$$$" + i + "$$$", temp);
                }
            }
            return(str);
        }
Пример #9
0
        /// <summary>
        /// 载入布局文件
        /// </summary>
        /// <param name="strIn"></param>
        /// <param name="theme"></param>
        /// <returns></returns>
        public static string DoLayout(string strIn, string type, string webpath, string mediapath)
        {
            string layout = RegexTool.GetRegValue(strIn, @"{[Ll][Aa][Yy][Oo][Uu][Tt]:(.*?)}");
            string cs     = RegexTool.GetRegValue(strIn, @"({[Cc][Ll][Aa][Ss][Ss]:.*?})");

            if (layout == "")
            {
                return(cs + strIn);
            }

            string layoutpath    = "";
            string layoutContent = "";

            if (mediapath != "")
            {
                layoutpath    = webpath + mediapath + "/layout/" + layout + ".layout";
                layoutpath    = ThemeUrl.GetFullPath(layoutpath);
                layoutContent = HtmlEngine.ReadTxt(layoutpath);
            }
            if (layoutContent == "")
            {
                layoutpath    = webpath + "/theme/system/systempage/" + type + "/layout/" + layout + ".layout";
                layoutpath    = ThemeUrl.GetFullPath(layoutpath);
                layoutContent = HtmlEngine.ReadTxt(layoutpath);
            }
            if (layoutContent == "")
            {
                layoutpath    = webpath + "/theme/system/layout/" + layout + ".layout";
                layoutpath    = ThemeUrl.GetFullPath(layoutpath);
                layoutContent = HtmlEngine.ReadTxt(layoutpath);
            }
            if (layoutContent == "")
            {
                return("");
            }
            string[] holderArray = RegexTool.GetSimpleRegResultArray(layoutContent, @"({[Hh][Oo][Ll][Dd][Ee][Rr]:.*?})");
            foreach (string holder in holderArray)
            {
                string tag    = RegexTool.GetRegValue(holder, @"{[Hh][Oo][Ll][Dd][Ee][Rr]:(.*?)}");
                string regtag = "";
                foreach (char t in tag)
                {
                    regtag += "[" + t.ToString().ToUpper() + t.ToString().ToLower() + "]";
                }
                string holdercontent = RegexTool.GetRegValue(strIn, @"<" + regtag + ">(.*?)</" + regtag + ">");
                layoutContent = RegexTool.ReplaceRegValue(layoutContent, @"{[Hh][Oo][Ll][Dd][Ee][Rr]:" + tag + ".*?}", holdercontent);
            }
            //载入重写模块
            string[] rewriteArray = RegexTool.GetSimpleRegResultArray(strIn, @"({[Rr][Ee][Ww][Rr][Ii][Tt][Ee]:.*?})");
            foreach (string rewrite in rewriteArray)
            {
                string tag  = RegexTool.GetRegValue(rewrite, @"{[Rr][Ee][Ww][Rr][Ii][Tt][Ee]:(.*?)}");
                string from = "";
                string to   = "";
                from = tag.Substring(0, tag.IndexOf(" "));
                to   = tag.Substring(tag.IndexOf(" ") + 1, tag.Length - from.Length - 1);
                string regfrom = "";
                string regto   = "";
                foreach (char t in from)
                {
                    regfrom += "[" + t.ToString().ToUpper() + t.ToString().ToLower() + "]";
                }
                foreach (char t in to)
                {
                    regto += "[" + t.ToString().ToUpper() + t.ToString().ToLower() + "]";
                }
                string holdercontent = RegexTool.GetRegValue(strIn, @"<" + regto + ">(.*?)</" + regto + ">");
                if (holdercontent == "")
                {
                    holdercontent = "{MOD:" + to + "}";
                }
                layoutContent = RegexTool.ReplaceRegValue(layoutContent, @"{[Mm][Oo][Dd]:" + regfrom + "}", holdercontent);
            }
            layoutContent = cs + layoutContent;
            return(layoutContent);
        }
Пример #10
0
        /// <summary>
        /// 生成后台的单个文件
        /// </summary>
        /// <param name="Path">生成文件名已经路径</param>
        /// <param name="Content"></param>
        /// <param name="WebPath"></param>
        /// <returns></returns>
        public static void CreatAdminAspx(string Path, string Content, string type, string mediapath)
        {
            if (Content == "")
            {
                return;
            }
            string     FileName   = "";
            BaseConfig bf         = ShopCache.GetBaseConfig();
            string     WebPath    = Site.Instance.WebPath;
            string     serverpath = "";

            if (System.Web.HttpContext.Current == null)
            {
                serverpath = System.Web.HttpRuntime.AppDomainAppPath;
            }
            else
            {
                serverpath = System.Web.HttpContext.Current.Server.MapPath(@"~/");
            }
            try
            {
                Path     = ThemeUrl.GetFullPath(Path);
                FileName = ThemeUrl.GetFileName(Path);
                Path     = ThemeUrl.GetPath(Path);
                string PhysicsPath = serverpath + Path;
                if (!Directory.Exists(PhysicsPath))
                {
                    Directory.CreateDirectory(PhysicsPath);
                }
                string PhysicsFileName = serverpath + Path + FileName;
                if (System.IO.File.Exists(PhysicsFileName))
                {
                    System.IO.File.Delete(PhysicsFileName);
                }
                Content = DoCodeConvert(Content, type, WebPath, mediapath);
                //=============================================================
                //处理特殊页面引用

                string cs = RegexTool.GetRegValue(Content, @"{[Cc][Ll][Aa][Ss][Ss]:(.*?)}");
                if (cs != "")
                {
                    string pagehead = "<%@ Page Language=\"C#\" AutoEventWireup=\"true\" Inherits=\"" + cs + "\" validateRequest=\"false\"%>";
                    Content = RegexTool.ReplaceRegValue(Content, @"<%@ Page .*? %>", "");
                    Content = pagehead + Content;
                    //if (type == "supplier")
                    //    Content = Content.Replace("Shop.Bussiness.SupplierPageBase", cs);
                    //else
                    //    Content = Content.Replace("Shop.Bussiness.AdminPageBase", cs);
                }
                //处理资源路径
                string Path_JS    = WebPath + "/system/systempage/" + type + "/js";
                string Path_Image = WebPath + "/system/systempage/" + type + "/images";
                string Path_CSS   = WebPath + "/system/systempage/" + type + "/css";
                Path_JS    = RegexTool.ReplaceRegValue(Path_JS, @"//*/", "/");
                Path_Image = RegexTool.ReplaceRegValue(Path_Image, @"//*/", "/");
                Path_CSS   = RegexTool.ReplaceRegValue(Path_CSS, @"//*/", "/");
                Content    = RegexTool.ReplaceRegValue(Content, @"{/[Jj][Ss]}", Path_JS);
                Content    = RegexTool.ReplaceRegValue(Content, @"{/[Cc][Ss][Ss]}", Path_CSS);
                Content    = RegexTool.ReplaceRegValue(Content, @"{/[Ii][Mm][Aa][Gg][eE]}", Path_Image);
                Content    = RegexTool.ReplaceRegValue(Content, @"<!--.*?-->", "");
                Content    = RegexTool.ReplaceRegValue(Content, @"{[Cc][Ll][Aa][Ss][Ss]:.*?}", "");

                HtmlEngine.Instance.WriteFile(PhysicsFileName, Content);
            }
            catch (Exception ex)
            {
            }
        }
Пример #11
0
 public string URL(string code, int para, string url)
 {
     return(ThemeUrl.GetURL(code, para.ToString(), url, CurrentTheme, CurrentLanguage));
 }
Пример #12
0
 public string URL(string code, string para)
 {
     return(ThemeUrl.GetURL(code, para, "", CurrentTheme, CurrentLanguage));
 }
Пример #13
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            pcode = "P_ShopIndex";
            LoadTheme(themecode, siteid, languagecode, pcode);
            id        = Rint_Para("0");    //商家ID
            cid       = Rint_Para("1");    //商品分类
            list      = Rstring_Para("2"); //列表或网格
            sort      = Rstring_Para("3"); //排序
            key       = Rstring_Para("5"); //关键词
            pageindex = RequestTool.RequestInt("page", 1);
            parentcid = 0;
            supplier  = B_Lebi_Supplier.GetModel("id = " + id);
            if (supplier == null)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            int Supplier_id = supplier.User_id;

            if (cid != 0)
            {
                producttype = B_Lebi_Supplier_ProductType.GetModel(cid);
                if (producttype.parentid > 0)
                {
                    parentcid = producttype.parentid;
                }
                else
                {
                    parentcid = cid;
                }
            }
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_ShopIndex", id) + "\"><span>" + Lang(supplier.Name) + "</span></a>";

            where = "Type_id_ProductStatus = 101 and Product_id=0 and Supplier_id = " + id + "";
            if (cid > 0)
            {
                if (DataBase.DBType == "sqlserver")
                {
                    where += " and Charindex('," + cid + ",',','+Supplier_ProductType_ids+',')>0";
                }
                if (DataBase.DBType == "access")
                {
                    where += " and Instr(','+Supplier_ProductType_ids+',','," + cid + ",')>0";
                }
            }
            if (key != "")
            {
                where += " and Name like '%" + key + "%'";
            }
            if (sort == "")
            {
                sort = "1";
            }
            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
            {
                order = " Count_Sales_Show desc"; ordertmp = "a";
            }
            products    = B_Lebi_Product.GetList(where, order, PageSize, pageindex);
            recordCount = B_Lebi_Product.Counts(where);
            //id={0}&pid={1}&cid={2}&list={3}&sort={4}&tid={5}&page={6}
            string url = URL("P_ShopIndex", id + "," + cid + "," + list + "," + sort + ",{0}," + key + "");

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage);
            string supplierservicepannelcon = supplier.ServicePanel;

            supplierservicepannel = B_ServicePanel.GetModel(supplierservicepannelcon);

            headcontent = supplier.head;
            longbar     = supplier.longbar;
            shortbar    = supplier.shortbar;
            //跳转至设置的皮肤页面
            Lebi_Supplier_Skin skin = B_Lebi_Supplier_Skin.GetModel(supplier.Supplier_Skin_id);

            if (skin != null)
            {
                string filename = HttpContext.Current.Request.Url.AbsolutePath.ToString().ToLower();
                if (!filename.Contains("default" + skin.id + ".aspx"))
                {
                    string tourl = Shop.Bussiness.Site.Instance.WebPath + "/" + CurrentLanguage.Path + "/shop/default" + skin.id + ".aspx?id=" + supplier.id + "&cid=" + cid + "&list=" + list + "&sort=" + sort + "&page=" + pageindex;
                    tourl = ThemeUrl.CheckPath(tourl);
                    Response.Redirect(tourl);
                    //Response.Write(tourl);
                }
            }
        }
Пример #14
0
 /// <summary>
 /// 返回相应主题的跳转地址
 /// </summary>
 /// <param name="url"></param>
 /// <returns></returns>
 public string JumpURL(string url)
 {
     url = "/" + CurrentLanguage.Path + "/" + url;
     url = ThemeUrl.CheckURL(url);
     return(url);
 }
Пример #15
0
 public string URL(string code, string para, string url)
 {
     return(ThemeUrl.GetURL(code, para, url, CurrentSite, CurrentLanguage));
 }
Пример #16
0
 public string URL(string code, int para)
 {
     return(ThemeUrl.GetURL(code, para.ToString(), "", CurrentSite, CurrentLanguage));
 }