예제 #1
0
        private void CreateSingleTemplate(string filename, string path)
        {
            int result     = -1;
            int templateid = Convert.ToInt32(AdminTemplates.GetAllTemplateList(Utils.GetMapPath(@"..\..\templates\")).Select("directory='" + path + "'")[0]["templateid"].ToString());

            if (filename != "")
            {
                ForumPageTemplate forumpagetemplate = new ForumPageTemplate();
                forumpagetemplate.GetTemplate(BaseConfigs.GetForumPath, path, filename, 1, templateid);
                result = 1;
            }
            Response.Write(result);
            Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
            Response.Expires         = -1;
            Response.End();
        }
예제 #2
0
 private void InitializeComponent()
 {
     this.EditUser.Click              += new EventHandler(this.EditUser_Click);
     this.EditForum.Click             += new EventHandler(this.EditForum_Click);
     this.EditUserGroup.Click         += new EventHandler(this.EditUserGroup_Click);
     this.UpdateCache.Click           += new EventHandler(this.UpdateCache_Click);
     this.CreateTemplate.Click        += new EventHandler(this.CreateTemplate_Click);
     this.UpdateForumStatistics.Click += new EventHandler(this.UpdateForumStatistics_Click);
     foreach (DataRow dataRow in AdminTemplates.GetAllTemplateList(Utils.GetMapPath("..\\..\\templates\\")).Rows)
     {
         if (dataRow["valid"].ToString() == "1")
         {
             this.Templatepath.Items.Add(new ListItem(dataRow["name"].ToString(), dataRow["directory"].ToString()));
         }
     }
     this.Username.AddAttributes("onkeydown", "if(event.keyCode==13) return(document.forms(0).EditUser.focus());");
     this.Usergroupid.AddTableData(UserGroups.GetUserGroupForDataTable(), "grouptitle", "groupid");
 }
예제 #3
0
        public static void BuildTemplate(string directorypath)
        {
            int templateid = Convert.ToInt32(AdminTemplates.GetAllTemplateList(AppDomain.CurrentDomain.BaseDirectory + "templates/").Select("directory='" + directorypath + "'")[0]["templateid"].ToString());

            Hashtable ht = new Hashtable();

            GetTemplates("default", ht);

            if (directorypath != "default")
            {
                GetTemplates(directorypath, ht);
            }

            ForumPageTemplate forumpagetemplate = new ForumPageTemplate();

            foreach (string key in ht.Keys)
            {
                string filename = key.Split('.')[0];
                forumpagetemplate.GetTemplate("/", directorypath, filename, 1, templateid);
            }
        }
예제 #4
0
        public static void BuildTemplate(string directorypath)
        {
            int templateid = Convert.ToInt32(AdminTemplates.GetAllTemplateList(Utils.GetMapPath(@"..\..\templates\")).Select("directory='" + directorypath + "'")[0]["templateid"].ToString());

            Hashtable ht = new Hashtable();

            GetTemplates("default", ht);

            if (directorypath != "default")
            {
                GetTemplates(directorypath, ht);
            }
            ForumPageTemplate forumpagetemplate = new ForumPageTemplate();

            foreach (string key in ht.Keys)
            {
                string   filename = key.Split('.')[0];
                string[] template = ht[key].ToString().Split('\\');
                forumpagetemplate.GetTemplate(BaseConfigs.GetForumPath, template[0], filename, template.Length >= 2 ? template[template.Length - 1] : "", 1, templateid);
            }
        }
예제 #5
0
        private void InitializeComponent()
        {
            this.EditUser.Click              += new EventHandler(this.EditUser_Click);
            this.EditForum.Click             += new EventHandler(this.EditForum_Click);
            this.EditUserGroup.Click         += new EventHandler(this.EditUserGroup_Click);
            this.UpdateCache.Click           += new EventHandler(this.UpdateCache_Click);
            this.CreateTemplate.Click        += new EventHandler(this.CreateTemplate_Click);
            this.UpdateForumStatistics.Click += new EventHandler(this.UpdateForumStatistics_Click);
            this.Load += new EventHandler(this.Page_Load);

            //装入有效的模板信息项
            foreach (DataRow dr in AdminTemplates.GetAllTemplateList(AppDomain.CurrentDomain.BaseDirectory + "templates/").Rows)
            {
                if (dr["valid"].ToString() == "1")
                {
                    Templatepath.Items.Add(new ListItem(dr["name"].ToString(), dr["directory"].ToString()));
                }
            }
            Username.AddAttributes("onkeydown", "if(event.keyCode==13) return(document.forms(0).EditUser.focus());");
            Usergroupid.AddTableData(DatabaseProvider.GetInstance().GetUserGroupsStr());
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int    result   = -1;
                string filename = DNTRequest.GetString("filename");
                string path     = DNTRequest.GetString("path");

                int templateid = Convert.ToInt32(AdminTemplates.GetAllTemplateList(AppDomain.CurrentDomain.BaseDirectory + "templates/").Select("directory='" + path + "'")[0]["templateid"].ToString());

                if (filename != "")
                {
                    ForumPageTemplate forumpagetemplate = new ForumPageTemplate();
                    forumpagetemplate.GetTemplate("/", path, filename, 1, templateid);
                    result = 1;
                }

                Response.Write(result);
                Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
                Response.Expires         = -1;
                Response.End();
            }
        }
 private DataTable buildGridData()
 {
     return(AdminTemplates.GetAllTemplateList(path));
 }