Exemplo n.º 1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="_formatsystem">是否初始化site</param>
 public Common(bool _formatsystem)
 {
     if (System.Web.HttpContext.Current.Application["jcmsV5"] == null)
     {
         System.Web.HttpContext.Current.Application.Lock();
         System.Web.HttpContext.Current.Application["jcmsV5"] = new JumboTCMS.DAL.SiteDAL().GetEntity();
         System.Web.HttpContext.Current.Application.UnLock();
     }
     if (_formatsystem) site = (JumboTCMS.Entity.Site)System.Web.HttpContext.Current.Application["jcmsV5"];
 }
Exemplo n.º 2
0
        /// <summary>
        /// 获得网站参数
        /// </summary>
        /// <returns></returns>
        public JumboTCMS.Entity.Site GetEntity()
        {
            JumboTCMS.Entity.Site eSite = new JumboTCMS.Entity.Site();
            eSite.Name = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "Name");
            eSite.Name2 = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "Name2");
            eSite.Url = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "Url");
            if (eSite.Url == "")
                eSite.Url = JumboTCMS.Utils.App.Url;
            eSite.Dir = JumboTCMS.Utils.App.Path;
            eSite.ICP = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "ICP");
            eSite.Keywords = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "Keywords");
            eSite.Description = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "Description");
            eSite.AllowReg = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "AllowReg") == "1";
            eSite.CheckReg = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "CheckReg") == "1";
            eSite.IsHtml = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "IsHtml") == "1";
            eSite.StaticExt = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "StaticExt").ToLower();

            eSite.TitleTail = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "TitleTail");
            eSite.AdminGroupId = JumboTCMS.Utils.Validator.StrToInt(JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "AdminGroupId"), 5);
            eSite.CookieDomain = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "CookieDomain");
            eSite.CookiePath = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "CookiePath");
            eSite.CookiePrev = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "CookiePrev");
            eSite.CookieKeyCode = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "CookieKeyCode");
            eSite.UrlReWriter = (JumboTCMS.Utils.Validator.StrToInt(JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "UrlReWriter"), 0) == 1);
            eSite.ExecuteSql = (JumboTCMS.Utils.Validator.StrToInt(JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "ExecuteSql"), 0) == 1);
            eSite.CreatePages = JumboTCMS.Utils.Validator.StrToInt(JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "CreatePages"), 20);
            eSite.ForumAPIKey = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "ForumAPIKey");
            eSite.ForumUrl = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "ForumUrl");
            eSite.DebugKey = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "DebugKey");
            if (eSite.DebugKey.Length == 0) eSite.DebugKey = "1111-2222-3333-4444";
            eSite.MailOnceCount = JumboTCMS.Utils.Validator.StrToInt(JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "MailOnceCount"), 15);
            eSite.MailTimeCycle = JumboTCMS.Utils.Validator.StrToInt(JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "MailTimeCycle"), 300);
            eSite.MailPrivateKey = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "MailPrivateKey");
            eSite.AdminCheckUserState = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "AdminCheckUserState") == "1";//(add:2011-03-07)
            eSite.MainSite = (JumboTCMS.Utils.Validator.StrToInt(JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "MainSite"), 0) == 1);
            eSite.WanSite = (JumboTCMS.Utils.Validator.StrToInt(JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "WanSite"), 0) == 1);
            eSite.ProductMaxBuyCount = JumboTCMS.Utils.Validator.StrToInt(JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "ProductMaxBuyCount"), 20);
            eSite.ProductMaxCartCount = JumboTCMS.Utils.Validator.StrToInt(JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "ProductMaxCartCount"), 20);
            eSite.ProductMaxOrderCount = JumboTCMS.Utils.Validator.StrToInt(JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "ProductMaxOrderCount"), 5);
            eSite.PassportTheme = JumboTCMS.Utils.XmlCOM.ReadConfig("~/_data/config/site", "PassportTheme");
            return eSite;
        }
Exemplo n.º 3
0
 /// <summary>
 /// 初始化系统信息
 /// </summary>
 protected void SetupSystemDate()
 {
     site = (JumboTCMS.Entity.Site)System.Web.HttpContext.Current.Application["jcmsV5"];
 }
Exemplo n.º 4
0
 public void LoadJumboTCMS()
 {
     this.ConnectDb();
     if (System.Web.HttpContext.Current.Application["jcmsV5"] == null)
     {
         SetupSystemDate();
     }
     site = (JumboTCMS.Entity.Site)System.Web.HttpContext.Current.Application["jcmsV5"];
     if (site.Url.Contains("jumbo") || site.Url.Contains("localhost") || site.Url.Contains("127.0.0.1")) Edition = "All";
 }
Exemplo n.º 5
0
 /// <summary>
 /// 初始化系统信息
 /// </summary>
 protected void SetupSystemDate()
 {
     site = new JumboTCMS.DAL.SiteDAL().GetEntity();
     System.Web.HttpContext.Current.Application.Lock();
     System.Web.HttpContext.Current.Application["jcmsV5"] = site;
     System.Web.HttpContext.Current.Application.UnLock();
 }