Example #1
0
		public moregadgets()
		{
			if (this.userid < 1)
			{
				HttpContext.Current.Response.Redirect(forumurlnopage + "/login.aspx?reurl=space");
				return;
			}
			GetOnlineUserInfo();

#if NET1			
            TabInfoCollection tc = Spaces.GetTabInfoCollectionByUserID(this.userid);
#else
            Discuz.Common.Generic.List<TabInfo> tc = Spaces.GetTabInfoCollectionByUserID(this.userid);
#endif
			
            currentUserSpaceConfig = Spaces.GetSpaceConfigByUserId(this.userid);
			int defaultTabId = Spaces.GetDefaultTabId(currentUserSpaceConfig, tc);
			string html = StaticFileProvider.GetContent(templatePath + "moregadgets.htm");
			TemplateEngine te = new TemplateEngine();
			te.Init(html, templatePath);
			te.Put("tabid", defaultTabId);
			te.Put("forumpath", BaseConfigs.GetForumPath);
			te.Put("config", currentUserSpaceConfig);
			te.Put("username", this.olusername);
			te.Put("userid", this.oluserid);
			te.Put("userkey", oluserkey);
            te.Put("forumurlnopage", forumurlnopage);
			double processtime = new TimeSpan(DateTime.Now.Ticks).Subtract(begints).Duration().TotalSeconds;
			te.Put("processtime", processtime);
			html = te.MergeTemplate();
			HttpContext.Current.Response.Clear();
			HttpContext.Current.Response.Write(html);
			HttpContext.Current.Response.End();
		}
Example #2
0
        public string ParseSubTemplate()
        {
            if (this._templateRoot == string.Empty)
            {
                return(string.Empty);
            }

            Regex           r  = new Regex(@"\#parse( )*\(([\s\S]+?)\)");
            MatchCollection ms = r.Matches(_template);

            for (int i = 0; i < ms.Count; i++)
            {
                string         codeBlock = ms[i].Groups[0].Value;
                string         filename  = this._templateRoot + ParseValue(ms[i].Groups[2].Value);
                string         content   = StaticFileProvider.GetContent(filename);
                TemplateEngine te        = new TemplateEngine();
                te.Init(content, this._templateRoot);
                te._context    = this._context;
                content        = te.MergeTemplate();
                this._template = this._template.Replace(codeBlock, content);
            }

            return(string.Empty);
        }
Example #3
0
		public string ParseSubTemplate()
		{
			if (this._templateRoot == string.Empty)
				return string.Empty;

			Regex r = new Regex(@"\#parse( )*\(([\s\S]+?)\)");
			MatchCollection ms = r.Matches(_template);

			for (int i = 0; i < ms.Count; i++)
			{
				string codeBlock = ms[i].Groups[0].Value;
				string filename = this._templateRoot + ParseValue(ms[i].Groups[2].Value);
				string content = StaticFileProvider.GetContent(filename);
				TemplateEngine te = new TemplateEngine();
				te.Init(content, this._templateRoot);
				te._context = this._context;
				content = te.MergeTemplate();
				this._template = this._template.Replace(codeBlock, content);
			}

			return string.Empty;
		}